how to find out jre version installed ,using a java program?

Hello,

Is there any way to find out the installed JRE version using a java program ?

The requirement is as follows:

There is a html page with 4 steps to install a software. each step is a link, which upon clicking does its work.

the first step is to install jre 1.4.2_11 if its not installed in the system. But how can i find out whether jre 1.4.2_11 is installed or not ?

Thanks in advance

[428 byte] By [java_prog_newa] at [2007-10-3 4:56:16]
# 1
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.htmlSystem properties might be able to do this.
TuringPesta at 2007-7-14 23:01:29 > top of Java-index,Java Essentials,Java Programming...
# 2

For the hell of it... here is a list of properties you can query:

java.version Java Runtime Environment version

java.vendor Java Runtime Environment vendor

java.vendor.url Java vendor URL

java.home Java installation directory

java.vm.specification.version Java Virtual Machine specification version

java.vm.specification.vendor Java Virtual Machine specification vendor

java.vm.specification.name Java Virtual Machine specification name

java.vm.version Java Virtual Machine implementation version

java.vm.vendor Java Virtual Machine implementation vendor

java.vm.name Java Virtual Machine implementation name

java.specification.version Java Runtime Environment specification version

java.specification.vendor Java Runtime Environment specification vendor

java.specification.name Java Runtime Environment specification name

java.class.version Java class format version number

java.class.path Java class path

java.library.path List of paths to search when loading libraries

java.io.tmpdir Default temp file path

java.compiler Name of JIT compiler to use

java.ext.dirs Path of extension directory or directories

os.name Operating system name

os.arch Operating system architecture

os.version Operating system version

file.separator File separator ("/" on UNIX)

path.separator Path separator (":" on UNIX)

line.separator Line separator ("\n" on UNIX)

user.name User's account name

user.home User's home directory

user.dir User's current working directory

TuringPesta at 2007-7-14 23:01:29 > top of Java-index,Java Essentials,Java Programming...
# 3
http://forum.java.sun.com/thread.jspa?threadID=168544
cotton.ma at 2007-7-14 23:01:29 > top of Java-index,Java Essentials,Java Programming...
# 4
Actually this is trickier than I first thought.I think you'll need Webstart or something. You can detect what version the browser has but of course the user could have more than one installed.
cotton.ma at 2007-7-14 23:01:29 > top of Java-index,Java Essentials,Java Programming...
# 5

By html you mean webpage? Or a JEditorPane?

In the webstart docs they give some JavaScript (commie browsers) and VBScript (IE) for working out if Java is installed, and if not either kicking off the webstart installer, or pointing the user as the correct page.

Webstart can autoupdate the JVM if it is not the version the webstarted application requires.

mlka at 2007-7-14 23:01:29 > top of Java-index,Java Essentials,Java Programming...
# 6

1) If you wan't to findout the version of java installed on windows systems,

try: C:\Program Files\Java\<<all versions installed>>"

2) If you wan't to findout the version of java that your program is using, try this,

System.out.println(System.getProperties().getProperty("java.version"));

best wishes,

balaji t

thibalajia at 2007-7-14 23:01:29 > top of Java-index,Java Essentials,Java Programming...