commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luc.maison...@free.fr
Subject Re: Creating jar files using commons-math-1.1
Date Tue, 30 May 2006 11:43:37 GMT
Rosie Chandler wrote:


>   If I was writing an extension that didn't include the commons-math library
> I would create the jar file using:
>
>   jar cvfm Normsdist.jar manifest.txt NormsdistExtension$testExtension.class
> NormsdistExtension.class
>
>   Except that when I attempt to use the Normsdist.jar file as an extension in
> my NetLogo project I again get the error reported that the commons-library
> classes can't be found.  How can I add the commons-math-1.1.jar to the
> classpath when I'm creating a jar file?  If I was just running the code I
> would use something like:
>
>   java -classpath NetLogo.jar;commons-math-1.1.jar;. NormsdistExtension
>
>   And this works fine, but I don't seem to be able to use the classpath
> command when I try to create the jar file...

You can try to use three jars : the two jars that you didn't create yourself
(NetLogo jar and commons jar) and your own Normsdist jar. This is what you have
already done, but I think you didn't specify the dependency between your jar and
the two other ones in your manifest.txt. In this manifest.txt file, you could
add a line like this:

  Class-Path: NetLogo.jar.jar commons-math-1.1.jar

If you need more jars, beware that the line length is limited and you should put
it on several lines with a specified syntax described in the jar format
documentation. With this line, when you specify only the upper level jar file,
it will also known the dependencies to include too.

The manifest.txt file can contain several fields, look at the documentation to
find the other useful ones (Main-class for example is useful for a standalone
application).

regards,
Luc



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


Mime
View raw message