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?
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...
If you are using a web page to launch a JNLP application,
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.
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?
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.