Skip to content

Instantly share code, notes, and snippets.

@pudquick
Created April 9, 2015 05:40
Show Gist options
  • Save pudquick/354badf94978f60375e1 to your computer and use it in GitHub Desktop.
Save pudquick/354badf94978f60375e1 to your computer and use it in GitHub Desktop.
Use Apple's PrivateFramework "JavaLaunching" functions to determine if the Apple JRE is installed (without triggering the dialog)
import sys
from ctypes import CDLL
JavaLaunching = CDLL('/System/Library/PrivateFrameworks/JavaLaunching.framework/JavaLaunching')
if (JavaLaunching.JLIsRuntimeInstalled() == 0):
print "Apple JRE is not installed."
sys.exit(1)
else:
print "Apple JRE is installed."
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment