ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ray Tayek <rta...@attbi.com>
Subject Failed to load Main-Class manifest from foo.jar
Date Mon, 04 Mar 2002 01:56:31 GMT
hi, i used the following sample ant script (copied from the doc) to build a 
jar. but when i try to run it using java -jar foo.jar, i get the above 
error message. i looked at the jar and the manifest has no files in it. is 
this a bug in ant? or do i need to invoke the jar in some different manner? 
or build the manifest myself? i am using ant 1.4.1 with j2sdk1.4.0

thanks

<project name="MyProject" default="dist" basedir=".">

   <!-- set global properties for this build -->
   <property name="src" value="."/>
   <property name="build" value="build"/>
   <property name="dist"  value="dist"/>

   <target name="init">
     <!-- Create the time stamp -->
     <tstamp/>
     <!-- Create the build directory structure used by compile -->
     <mkdir dir="${build}"/>
   </target>

   <target name="compile" depends="init">
     <!-- Compile the java code from ${src} into ${build} -->
     <javac srcdir="${src}" destdir="${build}"/>
   </target>

   <target name="dist" depends="compile">
     <!-- Create the distribution directory -->
     <mkdir dir="${dist}/lib"/>

     <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
     <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
   </target>

   <target name="clean">
     <!-- Delete the ${build} and ${dist} directory trees -->
     <delete dir="${build}"/>
     <delete dir="${dist}"/>
   </target>
</project>

---
ray tayek http://home.earthlink.net/~rtayek/
actively seeking telecommuting work
orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message