This was tested on OSX Mavericks through virtual box, and on Yosemite on a macbook.
I have a simple executable jar named "HelloWorld.jar".
I am tryin
I do not currently have an OS X machine handy to test this, but hints on the web from another question seem to imply that you need to set JAVA_HOME
and possibly PATH
in order to make java
work inside the app bundle.
Specifically, at the top of your shell script, before attempting to run your program, put the following lines, with appropriate changes for your system.
export JAVA_HOME=/path/to/my/java/install
export PATH=$PATH:/path/to/directory/containing/java
More generally, to diagnose the root cause of the problem, change the existing line in your script to capture stderr
and see if that gives you any useful output that might have otherwise been swallowed by the app's environment.
java -jar HelloWorld.jar > /Users/josh/Desktop/java-output.txt 2> /Users/josh/Desktop/java-error.txt
If you are able to capture the printed error, it may suffice to show you root cause.