I wrote a small Java desktop application using NetBeans, Java 8 and JavaFX 8 on my macBook underMacBook running macOS High Sierra. II can launch it in terminal manuallyfrom Terminal by usingexecuting a bashBash script (mentioned below), but double clicking on the JarJAR in finderFinder fails (right clicking and selecting openOpen fails, too)and and I receive a suggestion that I look for errors in Console, whatever that is.app, but get no other clue as to what's failing. It'sIt's a very specialized app that I'll probably only distribute to a couple of co-workers who don't work in terminalTerminal.
Google search has given me solutions that are out of date, the Oracle solution (out of date) provided a link that proved useless.
What do I need to do to be able make the JarJAR file executable from Finder? How can I get more information on what's wrong? Since it's not signed it might be that Gatekeeper is the culprit.
Edit as requested
My script is in ~/bin~/bin
which is included in PATH
I. I have a folder, ~/jars~/jars
for javaJava apps, each of which has its own folder. In that folder I have copied my project-> ... dist app.jar and my libs folder that has external jar libraries. TheThe script is executablehas execute permissions. Here is the script:
#!/bin/bash
java -jar $HOME/jars/myApp/myApp.
I can launch the app from terminalTerminal or from finderFinder but the first time finder will think I want to edit it so I must choose "Other"Other and then choose "terminal"Terminal. BTW it works exactly the same in Ubuntu, I just copied the script, dropped it into ~/bin~/bin
, and dropped the myAppmyApp
folder in ~/jars~/jars
. It mostly ran but the JRE on the Ubuntu machine, while Java 8, is a little older version than the one on my macMac and I get a run time error after a while. I think that updating to the same version will solve the problem as I don't know how to force NetBeans to include the JRE.