ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "romalopes" <>
Subject RE: How to run a .jar created by ant
Date Tue, 14 Oct 2003 15:52:44 GMT
Thank you, 
  I understood what you are meaning, but it havent worked yet. 
  The solution I did was:  I opened the socket.jar and xerces.jar in a directory, and included
the *.class in it.  But I think it isnt the best way. 
  If someone know how to do this....

  Thanks again...
>Message: 11
>   Date: Mon, 13 Oct 2003 22:46:20 -0700
>   From: "Harkness, David"
>Subject: RE: How to run a .jar created by ant
>romalopes <> once
>>   Using the ant I can cread the MSX.jar, but
>when I run this jar the
>>   follow error appears: Exception in Thread
>> java.lang.NoclassDefFoundError: msx/MSX 
>>   Another problem is how to use the classpath
>>	 <target name="jarMSX" description="faz o
>jar do MSX">
>>		 <jar
>>			 <fileset
>>		     <fileset
>>		     <fileset
>>		     <fileset
>>		     <manifest >
>>			     <attribute
>> value="${}"/>
>>			 <attribute
>name="Main-class" value="msx.MSX"/>
>>			 <attribute
>> value="${path.classpath}\socket.jar
>>		 </manifest> </jar>
>>	 </target>
>I haven't done this myself, but from what I know
>of Ant and Java, I
>suspect your problem is with the manifest's
>classpath. Keep in mind that
>when you include the file
>  /foo/bar/lib/xerces.jar
>into your JAR, it strips the directory entirely.
>Thus you locate it as
>"xerces.jar" without a path component.
>Similarly, when you include a
>bunch of *.class files from a hierarchy, it
>strips the root
>("${dir.bin}/") from the files and only includes
>the package hierarchy.
>Given the above, you should merely have to
>change the "Class-Path" line
>to this:
>  <attribute name="Class-Path" value="socket.jar
>Hmm, you also have an extra close quote
>(/xerces.jar""/>) unless that's
>just a typo. I figure Ant wouldn't run as the
>XML is invalid. Anyway,
>give that a shot. :)
>David Harkness
>Sr. Software Engineer
>Sony Pictures Digital Networks
>(310) 482-4756

Acesse nosso portal

Porque internet grátis, nem a Embratel pode fazer mais barato. Mas pode fazer melhor.

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

View raw message