For a while, I had trouble running jar files on my Mac. I made sure I had both JRE and JDK installed, but I would still get the following error message:
Java application launch failed. Check Console for possible error messages related to "/Users/user/Downloads/program.jar".
Recently, I come across a Reddit post that suggested changing some privacy settings, but it didn’t mention which settings to change, so I looked into it and found the security and privacy settings that blocked my Java applications from running.
To run a jar file on Mac, go to System Preferences > Security & Privacy > Privacy
. On the left menu, scroll down until you see Files and Folders
. Click on Files and Folders
to see the text “Allow the apps to access files and folders.” Make sure the Downloads Folder, Documents Folder, and Desktop Folder under java are checked.
Click the lock to make changes.
If your issue was caused by the same reason, you should now be able to launch a jar application by clicking on the jar file.
Alternatively, you can launch a Java application using the command line. java -jar path/application.jar
Update
As mentioned on Oracle’s website, “The JRE will not show up in the Java Preferences list unless you install the full JDK.”
Q: I have Oracle’s version the JRE installed, but it is not listed in Java Preferences.
A: This is correct. The JRE will not show up in the Java Preferences list unless you install the full JDK.”
https://docs.oracle.com/javase/7/docs/technotes/guides/jweb/mac-faq.html
Hope that helped!