Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAR distribution misery

 
R Harvey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
R Harvey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic