MasterGberry
MasterGberry

Reputation: 2860

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.

Upvotes: 0

Views: 142

Answers (3)

pspet
pspet

Reputation: 184

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

Upvotes: 0

Hot Licks
Hot Licks

Reputation: 47759

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

No quotes, and use :, not ;.

Upvotes: 1

nimsson
nimsson

Reputation: 950

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.

Upvotes: 1

Related Questions