ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "romalopes" <romalo...@click21.com.br>
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...
  Anderson.
  
  
>Message: 11
>   Date: Mon, 13 Oct 2003 22:46:20 -0700
>   From: "Harkness, David"
><DHarkness@sonypictures.com>
>Subject: RE: How to run a .jar created by ant
>
>romalopes <mailto:romalopes@click21.com.br> once
>said:
>>   Using the ant I can cread the MSX.jar, but
>when I run this jar the
>>   follow error appears: Exception in Thread
>"main"
>> java.lang.NoclassDefFoundError: msx/MSX 
>> 
>>   Another problem is how to use the classpath
>correctly.
>> 
>>	 <target name="jarMSX" description="faz o
>jar do MSX">
>>		 <jar
>destfile="${path.classpath}/MSX.jar">
>>			 <fileset
>dir="${dir.bin}"/>
>>		     <fileset
>file="${xerces.home}/xerces.jar"/>
>>		     <fileset
>file="${path.classpath}/socket.jar"/>
>>		     <fileset
>file="CONFIGURACAO_MSX.xml"/>
>>		     <manifest >
>>			     <attribute
>name="Built-By"
>> value="${user.name}"/>
>>			 <attribute
>name="Main-class" value="msx.MSX"/>
>>			 <attribute
>name="Class-Path"
>> value="${path.classpath}\socket.jar
>${xerces.home}/xerces.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
>xerces.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 www.click21.com.br

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



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


Mime
View raw message