简体   繁体   中英

Resolve CLASSPATH with two JARs

I have a java app that needs two jar files to run. craftbukkit.jar is the one that holds the main function, and commons-dbcp-1.4.jar is what I need to allow mysql pooling. I am having issues getting the CLASSPATH to behave properly.

Can someone help point out what I am doing wrong here?

java -Xincgc -Xmx1G -cp "craftbukkit.jar;commons-dbcp-1.4.jar" org.bukkit.craftbukkit.Main nogui

Can't seem to find the Main when i do this, and without the commonds-dbcp-1.4.jar it fails to load properly.

Add the line

Class-Path: commons-dbcp-1.4.jar

to Manifest.mf and make sure you leave an empty line at the end of the file assuming that commons-dbcp-1.4.jar is in the same directory.

Use java -Xincgc -Xmx1G -cp craftbukkit.jar:commons-dbcp-1.4.jar org.bukkit.craftbukkit.Main nogui

No quotes, and use : , not ; .

Check your "path separator". Wich OS you are running on?

For Windows, path separator is ";". On Linux you should use ":"

Windows:

java -Xincgc -Xmx1G -cp "craftbukkit.jar;commons-dbcp-1.4.jar" org.bukkit.craftbukkit.Main nogui

Linux:

java -Xincgc -Xmx1G -cp "craftbukkit.jar:commons-dbcp-1.4.jar" org.bukkit.craftbukkit.Main nogui

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM