Detecting installed JRE

Hi.

I am looking for an elegant way to detect JREs installed on the machine
(not as a part of a product, but from a JRE installer).

We're using the latest InstallShield.

I can think of the following ways:

1. Looking at C:\Program Files\Java. Granted, this is a very crude way
as users can install JREs wherever they want, but it's also a very
simple way.

2. Looking at the System32\Java.exe directory under the Windows
directory, it seems like the most recently installed JRE puts its
Java.exe there.

3. Look at the same data as the Add/Remove Programs control panel looks
at in registry and find the JREs.

Is there another way that I am missing?

Thanks,
Amnon

1 comment

Another way I realized I have now:
Registry key: "HKLM/SOFTWARE/JavaSoft/Java Runtime Environent/".

Still looking for the most elegant / straight forward / safe way.

Thanks,
Amnon

Amnon I. Govrin wrote:

Hi.

I am looking for an elegant way to detect JREs installed on the machine
(not as a part of a product, but from a JRE installer).

We're using the latest InstallShield.

I can think of the following ways:

1. Looking at C:\Program Files\Java. Granted, this is a very crude way
as users can install JREs wherever they want, but it's also a very
simple way.

2. Looking at the System32\Java.exe directory under the Windows
directory, it seems like the most recently installed JRE puts its
Java.exe there.

3. Look at the same data as the Add/Remove Programs control panel looks
at in registry and find the JREs.

Is there another way that I am missing?

Thanks,
Amnon

0

Please sign in to leave a comment.