I am responsible for a Java application which is deployed on multiple platforms including OS X. With recent versions of the application we distribute two separate bundles for OS X - one which uses the JavaApplicationStub provided by Apple, and another one which includes a bundled JDK 7 and uses a launcher produced in-house (a modification of Oracle's JavaAppLauncher).
The issue is, with the latter bundle, Mac OS X still insists on you having Java 6 installed if you try to run the application. Specifically the message says:
"To open (application), you need a Java SE 6 runtime. Would you like to install one now?"
If you don't install Java SE 6, you are unable to run the application, despite the fact that JDK 7 is bundled (and, if you do install Java 6, it nevertheless runs with the bundled Java 7).
What I'm struggling to figure out is how OS X decides that the application requires Java? I've tried renaming the 'Java' dictionary in the Info.plist file, and renaming the Java subfolder within the Resources folder, without success. Does anyone have any ideas? Surely it's possible to have an application with a bundled JDK run without requiring a system JDK to be installed?
Java is not required and is not preinstalled in OS X.
Type terminal in the search bar and open it by clicking on the icon in the search results. 3. Once in the command line, run the command: java -version . The output should display the Java version installed on your MacOS.
I've found the answer (with help from Mike Swingler on the [email protected] mailing list).
The presence of the 'Java' dictionary in the Info.plist file is what triggers the dialog, however, changing the name of the dictionary after trying to start the app isn't good enough. The system somehow caches the requirement for Java and so simply issues the dialog again. To avoid this it was necessary to download a fresh copy of the application and make the change before trying to run it for the first time (I'm told since that renaming the app would suffice, even renaming it and then again back to the original name).
Fortunately, this means that all we have to do is change the name of the 'Java' dictionary, and alter our customised launcher so that it uses the new dictionary name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With