EddyR
EddyR

Reputation: 6941

specifing path to class file from java command line?

I'm running a local script to automatically compile some .java files and deploy the .class files to a remote server.

On the remote server I can then issue this command from the directory I uploaded it too (i.e., /tmp) and it works fine....

java -cp .:/usr/share/java/mysql-connector-java.jar gpimport

But to execute it from my local script I need to specify the path of the .class file in /tmp so java knows where to look for it.

How do I do that? I thought it would've been really simple to figure out but I haven't had any luck so far!

Upvotes: 1

Views: 249

Answers (1)

dacwe
dacwe

Reputation: 43504

Just change the first classpath . to /tmp:

java -cp /tmp:/usr/share/java/mysql-connector-java.jar gpimport

Upvotes: 2

Related Questions