PDB PDB - 1 year ago 103
Linux Question

convert windows javac command to linux

I'm having troubles with converting my javac command as used under windows (my libraries are placed within the lib folder, the source code within the src folder, and the compiled code should be placed within the bin folder):

javac -cp lib/\* -d bin src/\*.java

into the correct linux javac command. I have tried many variations including

javac -cp lib/* -d bin src/*.java

but that doesn't seem to work :

"invalid flag: lib/org.eclipse.paho.client.mqttv3-1.0.2.jar".

I am looking for a solution to this already quite some time, so any advice on this would be highly appreciated!

Answer Source

This is one of those odd things that happens when you don't put quotes around an argument.

Solution worked out in comments section: "lib/" instead of lib/

javac -cp "lib/*" -d bin src/*.java

The other issue was that ; is needed instead of : in Linux for classpaths.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download