1

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!

1 Answer 1

2

Just change the first classpath . to /tmp:

java -cp /tmp:/usr/share/java/mysql-connector-java.jar gpimport
Sign up to request clarification or add additional context in comments.

4 Comments

Huh, this post didn't turn up until after @aioobe's. hmmm
The post was deleted for a short while, but originally it was before mine ;-)
Anyway, it's a real 'duh' moment. Can't believe I didn't realize that!
@EddyR: Yepp, those are the hardest problems!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.