These notes contain information for developers who are
deploying the Java 2 Runtime Environment (Java RE) on Microsoft Windows
platforms. For general platform-independent information about the Java
2 Runtime Environment, see Java 2
Runtime Environment Notes for Developers.
The installation program for the Microsoft Windows version of the Java
2 Runtime Environment uses the registry to record path and version
information. The application launcher in the system directory uses the
registry settings to obtain the location of the Java Runtime
Environment they are to use when launching an application.
You can consider using the registry settings in the deployment of
your applications in the following ways:
- If your application has an installation program, you can have
that program check the registry to determine which version, if any, of
the runtime environment already exists on the platform on which your
software is being installed. If an appropriate version of the Java RE
is not already installed, you can prompt the user to download and
install the Java 2 Runtime Environment, or your installation program
can install a copy of the Java 2 Runtime Environment that you
redistribute with your application.
- If you choose to use your own custom application launcher
rather than the application launchers that come with the Java 2 Runtime
Environment, you can nevertheless have your launcher check the runtime
environment's registry settings for the location and version of the
runtime environment on the local machine.
Java 2 Runtime Environment Registry Settings -
When installed, the Java 2 Runtime Environment creates the following
registry key:
HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment
This key contains the following string value which is set to the major.minor
version of the installed Java 2 Runtime
Environment:
| Name |
Default Value |
| CurrentVersion |
1.4 |
Note that CurrentVersion is set only if the version
being installed is the highest version number on the machine. For
example, if Java RE 1.3.1 already exists on a machine on which 1.4.2 is
being installed, then CurrentVersion will be set to 1.4.
If 1.4.2 is installed first, and then 1.3.1 is installed, CurrentVersion
will remain set to 1.4.
In addition, registry subkeys are created at
HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment\1.4
and
HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment\1.4.2
These keys contain the following settings information for use by the
runtime environment:
| Name |
Default Value |
| JavaHome |
C:\Program Files\Java\j2re1.4.2 |
| RuntimeLib |
C:\Program
Files\Java\j2re1.4.2\bin\client\jvm.dll |
| MicroVersion |
2 |
JavaHome is set to the full path name of the directory in
which the Java 2 Runtime Environment was installed. RuntimeLib
contains the full path name of the Java runtime DLL to use. MicroVersion
identifies the integer after the second dot in the version number of
the Java 2 Runtime Environment. For the Java 2 Runtime Environment,
v1.4.0, the value would be 0, for v1.4.1 it is 1,
etc.
In addition, keys are created for Java Plug-in and Java Web Start.
Java Plug-in Registry Settings -
The following key is created for Java Plug-in:
HKEY_LOCAL_MACHINE\Software\JavaSoft\Java
Plugin\1.4.2
This key contains the following values:
| Name |
Default Value |
| JavaHome |
C:\Program Files\Java\j2re1.4.2 |
| UseJava2IExplorer |
1 |
UseJava2IExplorer is type REG_DWORD. Its value is 1
if J2RE is the default VM for IE, 0 if not.
Java Web Start Registry Settings -
The following key is created for Java Web Start:
HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Web
Start\1.4.2
This key contains the following value:
| Name |
Default Value |
| Home |
C:\Program Files\Java\j2re1.4.2\javaws |
Two copies of the java.exe executable are installed. One
copy is in the bin directory of the Java RE. The second copy is placed
in either C:\windows\system or C:\winnt\system32,
depending on the system. Because of its location in the system
directory, this second copy of java.exe can be launched from
any directory location without giving the full path to it.
This second copy of the java.exe executable relies on
the CurrentVersion registry setting to determine which
registry key to use to look up the location of the Java RE. For
example, if the CurrentVersion registry is set to 1.4,
the java.exe executable in the system directory will look at
the HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime
Environment\1.4 key to determine where the Java RE is installed.
Note that the CurrentVersion registry value is that of
the most recently installed Java RE. If Java RE 1.3.1 is installed
after Java RE 1.4, then CurrentVersion will have a value of 1.3,
to match the version of the java.exe executable in the system
directory.