Cannot launch java cmd line program. -bash: ExternalLib/ant.jar: Permission denied

software development

#1

Hi. I get an error when I try to run a java program. The three .jar files exist.


[size=small][font=Courier]java -classpath bin;ExternalLib/ant.jar;ExternalLib/log4j-1.2.16.jar;ExternalLib/lucene-core-3.0.1.jar MyJavaAppName src/instructions.xml src/log4j.setting
Usage: java [-options] class [args…]
(to execute a class)
or java [-options] -jar jarfile [args…]
(to execute a jar file)

plus rest of the usage instructions for java <<<
-bash: ExternalLib/ant.jar: Permission denied
-bash: ExternalLib/log4j-1.2.16.jar: Permission denied
-bash: ExternalLib/lucene-core-3.0.1.jar: Permission denied[/font][/size]


the exact same instructions work on my windows machine. What do I have to do to not get the perms errors? I just ftp uploaded the full directory over.


#2

You’re getting bitten by the fact that the semicolon is a command separator in Linux. Throw a set of double quotes around your classpath.