aspose file tools*
The moose likes Java in General and the fly likes Class-path in manifest file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Class-path in manifest file" Watch "Class-path in manifest file" New topic
Author

Class-path in manifest file

Matthew Sessoms
Greenhorn

Joined: Apr 28, 2011
Posts: 6
Hello all,
I have a jar file that contains (among other things) a 'main' & 'lib' folder. I have the main-class set to main.Start. For the class-path, I want to reference the lib folder that's inside the jar file. I have lib/xx lib/yy lib/zz and so on. However, it's not recognizing the dependencies when I run it. In Eclipse, it runs fine. If I put ../lib/xx, the jar file references the lib folder that's *outside* the jar file (i.e., aa/dist/jar.jar, it references aa/lib). I want to be able to set the class-path to reference items *inside* it's own jar file. Is there a way to get around this? I've tried a simple jarring of all the jar files for outside the main jar file, but I can't get it working.

Thanks
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Entries in a manifest files' classpath is relative to the jar file's location. It don't search inside for a folder named lib but relative to the location where jar is placed.

So better create a lib folder alongside the jar file, place all the necessary jars in it and modify the manifest file accordingly.
 
wood burning stoves
 
subject: Class-path in manifest file
 
Similar Threads
what happen if i add jar file which is in hard drive
NoClassDefFoundError running a jar file from the command line
Can't run main class from JAR file
Issue with jboss\lib\endorsed jar loading
JDeveloper Deployment Question