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 开发者_StackOverflow社区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!
Just change the first classpath .
to /tmp
:
java -cp /tmp:/usr/share/java/mysql-connector-java.jar gpimport
精彩评论