Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Mountain Lion has this wonderful feature where running "java" pops up a dialog prompting the user to install Java (if it is not already installed). This is nice, but I'd prefer to have more control over this process because my users may not understand or know what this dialog is for.

I want to test if Java is present, then prompt the user with a dialog containing the message

My App requires Java.  Java is not currently installed on this system.
Do you wish to download and install Java now?

And then, if the user clicks "Yes", the application will initiate the OS X builtin download and installation of Java.

How do I test if Java is present? How do I initiate the download without the default OS X prompt?

share|improve this question

migrated from Aug 13 '12 at 3:36

This question came from our site for professional and enthusiast programmers.

Isn't that pretty much what Apple's existing dialog says already? – Mathias Schwarz Aug 1 '12 at 20:26
No. It says "To open java, you need a Java SE 6 runtime. Would you like to install one now?" The key difference that will make all the difference to my users is "My App requires Java." It's also very nice if the message says "Java is not currently installed on this system." which the default message doesn't have. – Jason Aug 7 '12 at 22:08

You must log in to answer this question.

Browse other questions tagged .