OK, I feel like a complete newbie posting this, but this has baffeled
me completely. I tried to execute the following:
java -cp a.jar -jar b.jar
Of course b.jar requires a.jar to run and both jars are in the same
directory. It worked on windows but not on Debian. I've checked a
million times that a.jar could be found by Debian (tried absolute
paths, relative paths, exported classpath env. variables, path env.
variables etc etc).
What could explain the difference between Windows and Debian? Are jars
treated differently on both platforms? Is it something in the manifest?
cyberco - 13 Feb 2006 21:58 GMT
Well......found the answer here:
http://mindprod.com/jgloss/jar.html#CLASSPATH
Qoute:
"If you use -jar on the java.exe command line, java.exe will quietly
ignore the set environment classpath and any -classpath or -cp command
line options."
See the page for details how to solve this issue.
Thanks, Rudy!
Roedy Green - 14 Feb 2006 06:27 GMT
>Qoute:
>"If you use -jar on the java.exe command line, java.exe will quietly
>ignore the set environment classpath and any -classpath or -cp command
>line options."
>
>See the page for details how to solve this issue.
see http://mindprod.com/jgloss/classpath.html#GOTCHAS

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Roedy Green - 13 Feb 2006 22:04 GMT
>What could explain the difference between Windows and Debian? Are jars
>treated differently on both platforms? Is it something in the manifest?
what is the current directory in either case relative to where the
jars live?

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
pwt - 14 Feb 2006 03:33 GMT
I don't know why it works on one OS but not another, but you may as
well do this anyway.
java -cp a.jar;b.jar SomeClassNameInsideOneOfTheJars