include external jar when running java -jar

Posted by prmatta on Stack Overflow See other posts from Stack Overflow or by prmatta
Published on 2010-05-26T04:48:05Z Indexed on 2010/05/26 4:51 UTC
Read the original article Hit count: 294

Filed under:
|
|
|
|

From my readings, when you execute a command as follows:

java -jar foo.jar

Then the main classpath is ignored and the classpath is taken from the manifest file.

Further, the classpath declared on the command line is also ignored. So in:

java -classpath /usr/local/jar/foobar.jar -jar foo.jar

/usr/local/jar/foobar.jar is ignored.

Lastly, I have read that the manifest file can only only contain relative paths, within the jar file.

So, how do you include absolute paths to external jars, that are present on the system, but not in the jar file being executed?

© Stack Overflow or respective owner

Related posts about java

Related posts about jar