• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Class-path in manifest file

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic