Running Java from an OSX “.app” bundle causes “Error -10810”

前端 未结 1 1979
眼角桃花
眼角桃花 2021-01-03 15:16

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

相关标签:
1条回答
  • 2021-01-03 16:08

    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.

    0 讨论(0)
提交回复
热议问题