Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jar Files: Kill me NOW.

 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create an executable JAR file, with the following structure:


Seems like, no matter what I put in the Class-Path entry of Manifest.mf, Java can't find the dependency jars in the embedded /lib folder. I've tried many variations on the following:

Class-Path: lib/depJar1.jar lib/depJar2.jar

or

Class-Path: ../lib/depJar1.jar

or

Class-Path: /lib/depJar1.jar

Nothing works, and, amazingly, Google is silent on this topic (as hard as that may be to believe).

Can anyone point me in the right direction?
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does that word "embedded" mean what I think it does?

The dependent jars are supposed to be in the lib directory under the directory where the executable jar is located. Not inside the executable jar.
 
Uli Hofstoetter
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AFAIK the standard classloader does not support this.

Maybe the classworlds framework can help you.
 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Does that word "embedded" mean what I think it does?

The dependent jars are supposed to be in the lib directory under the directory where the executable jar is located. Not inside the executable jar.


Okay, I'll check this out. I guess, coming from a servlet-development world, I'm just used to embedding them, without worrying about wether the WAR file gets exploded or not. Never occurred to me this could be different for JAR files.

thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic