Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class-path in manifest file

 
Matthew Sessoms
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic