Reputation: 3857
I have a batch file for windows containing following:
start "" javaw -jar %~p0/app.jar
How to get the same command in a Bash script?
Upvotes: 1
Views: 3166
Reputation: 532
I assume its a Java Swing (GUI based) app. You should be able to execute it using this:
cd /path/to/app
java -jar myApp.jar
Simply paste this code as it is in your bash script. The "cd" should take care of path issues. Do note, that the terminal will be freed only when the Java app is exited.
Upvotes: 1
Reputation: 28703
root=`dirname "$0"` # in case if I got %~p0
nohup javaw -jar "$root/app.jar" &
starts javaw
in background.
Upvotes: 2