PDA

View Full Version : JRE Installed?



NewsArchive
01-03-2012, 01:06 AM
Is there some way for me to sense whether the Java Runtime Engine is
installed, and perhaps what version it is?

Mike Hanson
www.boxsoft.net

NewsArchive
01-03-2012, 01:06 AM
Hi Mike,

> Is there some way for me to sense whether the Java Runtime Engine is
> installed, and perhaps what version it is?

As I understand it, there can be any number of installed JREs and JDKs on a
Windows machine, but only one will have the
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment registry item
set.

So I think the above registry can be used to detected an installed JRE
(including the version). The "CurrentVersion" value should store the
version number string.

Friedrich

NewsArchive
01-03-2012, 01:07 AM
Thanks, Friedrich. I also found the following in the IPServer's
run.bat:

if "%JAVA_HOME%"=="" goto no_javahome
if not exist "%JAVA_HOME%\bin\java.exe" goto no_javahome

I have to decide whether to provide a web link for installing the JRE,
or to just warn them to do it.

BTW, I'm about to send you a big message on my thoughts regarding the
IPServer installation.

Mike Hanson
www.boxsoft.net

NewsArchive
01-03-2012, 01:09 AM
Hmmm. My machine doesn't have that registry key, and I don't have a
%JAVA_HOME% environment variable, but I definitely have the JRE
installed.

I just dug around, and I've got some stuff in
HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment, but
it's just a folder with a single 1.6.0_23 subfolder. The subfolder
has a single "BalloonShown" boolean entry. Therefore, I suspect this
is a "settings" entry, rather than the official marker that the JRE is
installed.

I've got some other stuff beneath "Wow6432Node", but that doesn't
sound generic enough for my purposes.

Mike Hanson
www.boxsoft.net

NewsArchive
01-04-2012, 12:55 AM
Mike,

I found the following:

http://www.oracle.com/technetwork/java/javase/runtime-windows-137915.html

As I understand it, the only way to detect the runtime is via the

HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment

key.

You can then use "Get Registry SubKey" to detect subkeys and (if available)
read the version and installation path.

But I think that one of the Jave patches introduced a problem and so
"JavaHome" is not always set:

http://forum.bigfix.com/viewtopic.php?id=6872
http://forum.bigfix.com/viewtopic.php?pid=29104#29104

Friedrich

NewsArchive
01-04-2012, 12:55 AM
For whatever reason, I don't have that key on my system, but I
definitely have the JRE (1.6, I believe). Strange.

Mike Hanson
www.boxsoft.net

NewsArchive
01-04-2012, 12:56 AM
Better call Dr JRE

Jeff Slarve
www.jssoftware.com
www.twitter.com/jslarve

NewsArchive
01-04-2012, 12:56 AM
Yo, yo!

Mike Hanson
www.boxsoft.net