ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ray Tayek <>
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


<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 -->
     <!-- Create the build directory structure used by compile -->
     <mkdir dir="${build}"/>

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

   <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 name="clean">
     <!-- Delete the ${build} and ${dist} directory trees -->
     <delete dir="${build}"/>
     <delete dir="${dist}"/>

ray tayek
actively seeking telecommuting work
orange county java users group
hate spam?

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message