Java app uses own launcher and bundles JDK but OS X still insists that Java SE 6 be installed

Mike Swingler swingler at apple.com
Thu May 16 08:51:53 PDT 2013


On May 16, 2013, at 8:36 AM, Davin McCall <davmac at davmac.org> wrote:

> Hi,
> 
> 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?
> 
> I've also asked this on StackOverflow:
> http://stackoverflow.com/questions/16591780/how-does-mac-os-x-determine-that-an-application-needs-java

OS X uses the "Java" dictionary in the .app's Info.plist before the executable is launched.

Afterwards, if you have a primary executable or a library that loads before HotSpot which is linked against the JavaVM.framework, that will also kill the app, and trigger the Install-on-Demand experience.

I'd suggest checking your binaries with "otool -L".

Regards,
Mike Swingler
Apple Inc.


More information about the macosx-port-dev mailing list