This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes packing java file into JAr file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "packing java file into JAr file" Watch "packing java file into JAr file" New topic
Author

packing java file into JAr file

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
I have a java class file and its supporting jar files and want to pack it JAR,how It can be done.I read that ,packing jar inside a jar create problem
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24054
    
  13

Packing a jar into a jar doesn't cause a problem, per se; but the Java class loader won't know how to load classes from those "nested jars", so it won't accomplish anything useful, either.


[Jess in Action][AskingGoodQuestions]
jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
then please tell how it can be done??
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Distribute your library JAR files next to your program JAR file:
The manifest can then specify those JAR files in the Class-Path attribute:
Of course you should put all your library JAR files either in the same folder, or all in a subfolder like lib. That's just more consistent.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: packing java file into JAr file
 
Similar Threads
JAR file class not found exception
JAR size packing article
Unable to load resource
jar and JVM variables when packing
Deploying EJB and dependent classes