Chapter 2. Installing OpenJDK 11 for Windows with the archive
This procedure describes how to manually install OpenJDK 11 for Windows using the archive.
Procedure
- Download the archive of OpenJDK 11 for Windows.
Extract the contents of an archive to a directory of your choice.
NoteExtracting the contents of an archive to a directory path that does not contain spaces is recommended.
Update the
PATH
as below:Add the
bin
directory contained in your OpenJDK 11 for Windows installation path to the%PATH%
environment variable:C:\> setx /m PATH "%PATH%;C:\Progra~1\RedHat\java-11-openjdk-11.0.1.13-1\bin"
If the path contains spaces, use the shortened path name.
- Restart Command Prompt to reload the environment variables.
Verify the OpenJDK 11 for Windows is successfully installed, run
java -version
command in a command prompt and you must get the following output:openjdk version "11.0.3-redhat" 2019-04-16 LTS OpenJDK Runtime Environment 18.9 (build 11.0.3-redhat+7-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.3-redhat+7-LTS, mixed mode)
The
%JAVA_HOME%
environment variable must also be set to use some developer tools. Set the%JAVA_HOME%
environment variable as follows:- Open Command Prompt as an administrator.
Set the value of the environment variable to your OpenJDK 11 for Windows installation path:
C:\> setx /m JAVA_HOME "C:\Progra~1\RedHat\java-11-openjdk-11.0.1.13-1"
If the path contains spaces, use the shortened path name.
- Restart Command Prompt to reload the environment variables.