Chapter 1. Selecting a specific Red Hat build of OpenJDK from the installed versions for an application
You can select a specific Red Hat build of OpenJDK from the installed versions on Microsoft Windows for an application.
Prerequisites
- More than one Red Hat build of OpenJDK is already installed on the system.
Procedure
- Log in as a Windows system administrator.
-
On the command line, set the prompt to
C:/
. -
Enter
dir /b /s java.exe
to list all of the installed OpenJDKs on the system. Set the value of the environment variable to your Red Hat build of OpenJDK (or JRE) installation path:
setx -m JAVA_HOME "Path to Java"
If the path contains spaces, use the shortened path name.
- Restart Command Prompt to reload the environment variables.
Retrieve the value of the path variable:
echo %JAVA_HOME%
Set the value of path variable:
setx -m PATH "%PATH%;%JAVA_HOME%\bin";