my dog learned polymorphism*
The moose likes Java in General and the fly likes JAR distribution misery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "JAR distribution misery" Watch "JAR distribution misery" New topic
Author

JAR distribution misery

R Harvey
Greenhorn

Joined: Sep 17, 2002
Posts: 20
Hi.
I'm attempting to package up my nice new app into a jar file, ready to go out on the road. The app uses quite alot of third-party source JAR files, such as the Apache Batik rasteriser, bea's xmlbeans etc. etc. I need to be able to package my app into a JAR file so that the user can double click the jar file on his computer and have it appear like magic. Problem is, I can't get my jar file to include info about the external jars (batik etc), so that every time i try and run the thing i get NoClassDefFoundErrors. I have attempted to include a 'Class-Path' entry in my manifest file, but this seems to have zero effect. Here is a listing of my manifest file / directory structure:




I'm really confused as to what's going wrong, which end of the stick did I grab?? How big is the stick??? Why doesn't the stick like me???
Thanks.
Robin
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
For my apps I distribute (see sig), I just combine the third party jars into my app jar. I use Ant and it extracts the contents of the third party jars then packages those up in my app jar along with my app code. Makes one jar to distribute.
Brian


My Java Freeware:<br />MACCC - <a href="http://maccc.pipasoft.com" target="_blank" rel="nofollow">http://maccc.pipasoft.com</a><br />Nator - <a href="http://nator.pipasoft.com" target="_blank" rel="nofollow">http://nator.pipasoft.com</a>
R Harvey
Greenhorn

Joined: Sep 17, 2002
Posts: 20
Thanks for the response!
Would care care to elaborate a little??? I've tried to find some kind of documentation for this technique, but google came up nuts.
Robin
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
Elaborate? The only thing I can think of to elablorate is to show you my ANT build script that does the jarring for me. Here is the ANT target that does the jarring:

Notice that the unjar task unjars the 3rd-paryy jar into my target dir then the jar task jars up the target dir which now contains my compiled code plus the 3rdparty code.
Brian
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAR distribution misery
 
Similar Threads
Do jnlp file updates itself
Jasper Reports
batik SVG object gets: Gtk-WARNING **: cannot open display
batik SVG object under tomcat gets: Gtk-WARNING **: cannot open display:
Problem starting JBOSS 4.2.3