Java multiple classepath with :classes directive
Should be kind of trivial but say I have two jar
files in libA.jar
and libB.jar
in directory ./lib
java -cp ./lib/*:classes com.whatever.Start config.file
Runs smooth.
Now say those files are in distinct directories
/home/lib/libA.jar
./lib/libB.jar
I cannot start it with:
// thi开发者_StackOverflows doesn't work
java -cp /home/lib/libA.jar;./lib/libB.jar:classes com.whatever.Start config.file
What am I missing?
Thank you.
Under Linux you should use a ':' as path seperator, not semicolon:
java -cp /home/lib/libA.jar:./lib/libB.jar:classes com.whatever.Start config.file
Try this:
java -classpath /home/lib/libA.jar:./lib/libB.jar:classes com.whatever.Start config.file
精彩评论