Skip to main content

How to auto-install JRE 1.4

3 replies [Last post]
Joined: 2006-02-17
Points: 0

Is there an easy way of detecting if JRE 1.4 is installed on a machine and if not directing the user to the correct web page to do so?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-11
Points: 0

On Windows, you can examine the registry:
HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Enviroment

There are a couple of libraries around that can read the Windows registry.

Don't know what to do on Unix. InstallAnywhere examines a couple of places like /usr/java, but I've no idea if there is a standard for this...

Joined: 2006-02-17
Points: 0

If you are using a web page to launch a JNLP application,
you can look at what we did in JavaScript and VBScript

This works with IExplorer, Netscape, and Mozilla.
Mac folks can just skip to step 2 because they already know they have Java(tm) installed by Apple.

Mostly this page was to detect if JavaWebStart has been installed by the jnlp mime type being there. Once JavaWebStart is detected, we let the Java Version requirements in the JNLP file pull down the correct Java if needed.

If you are already executing code on their machine and you
you are not in a browser, you can do like Nightrider suggests.
you can try to run the command 'java -version' and parse the response. On most unixes & linuxes you can do a 'which java' to find the full path to that executable.

On my Debian Linux box:
$ which java

$ java -version
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)

The 'java -version' responds the same on my WinXP box.

Joined: 2006-02-17
Points: 0

I'm wondering if you could tell me how to have WebStart ask about installing the Desktop and Start menu items the first time it runs. We have an app we are deploying and the installing of desktop and start menu items seems to be hit or miss. Is there a setting in the JNLP where you can indicate when this is supposed to happen?


Jerald Dawson