Results 1 to 2 of 2
I am trying to get a bash file to run a java program with a bunch of arguments. This is what I tried 1. Create a little file > run_Java.sh ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-05-2011 #1
- Join Date
- Oct 2011
Simple batch file to run java program
This is what I tried
1. Create a little file > run_Java.sh
2. In the bash file type: echo "java -jar my_Java_app arguments". (To manually run the program I type "java -jar my_Java_app arguments" into the command line.)
3. Make it executable with chmod +x
4. Moved it to /usr/bin
5. Type run_Java.sh in terminal
The terminal just displays the command, but does not execute it.
I tried program and exec in place of echo.
- 11-07-2011 #2
Bash scripts work as direct input to the shell. So you put into a Bash script the exact lines that you want executed. "echo" prints out its argument, so if you put echo first, it (correctly) just prints out your command.
So just put the command you want to run.