开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜