views:

39

answers:

2

-java -classpath<> <classname> in the ".bat" file to launch java test from cmd windows how to do that using perl to launch java test from linux ?

+1  A: 

Don't use perl. For such a simple job, a simple shell script will do:

#!/bin/sh
/path/to/java -classpath foo.jar:bar.jar:. classname

Make the file executable with chmod +x filename and execute it with ./filename

Paul Tomblin
A: 

A similar approach using the -jar option is possible. Additionally, you can forward any command line parameters using the special parameter @.

#!/bin/sh
/path/to/java -jar foo.jar "${@}"
trashgod