Installing and using OpenJDK 11 for Windows
Abstract
Making open source more inclusive
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.
Providing feedback on Red Hat documentation
We appreciate your feedback on our documentation. To provide feedback, you can highlight the text in a document and add comments.
This section explains how to submit feedback.
Prerequisites
- You are logged in to the Red Hat Customer Portal.
- In the Red Hat Customer Portal, view the document in Multi-page HTML format.
Procedure
To provide your feedback, perform the following steps:
Click the Feedback button in the top-right corner of the document to see existing feedback.
NoteThe feedback feature is enabled only in the Multi-page HTML format.
- Highlight the section of the document where you want to provide feedback.
Click the Add Feedback pop-up that appears near the highlighted text.
A text box appears in the feedback section on the right side of the page.
Enter your feedback in the text box and click Submit.
A documentation issue is created.
- To view the issue, click the issue tracker link in the feedback view.
Chapter 1. OpenJDK 11 for Windows installation options
OpenJDK 11 for Windows can be installed using an archive or through a graphical user interface using an MSI-based installer.
Depending on your circumstance, use one of the following installation methods:
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.
Chapter 3. Updating OpenJDK 11 for Windows using the archive
OpenJDK 11 for Windows can be manually update using the archive.
Procedure
- Download the archive of OpenJDK 11.
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.
On Command Prompt, update
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.
Set the value of
PATH
variable if it is not set already:C:\> setx -m PATH "%PATH%;%JAVA_HOME%\bin";
- Restart Command Prompt to reload the environment variables.
Verify that
java -version
works without supplying the full path.C:\> java -version openjdk version "11.0.3" 2019-04-16 LTS OpenJDK Runtime Environment (build 11.0.3+7-LTS) OpenJDK 64-bit Server VM (build 11.0.3+7-LTS, mixed mode)
Chapter 4. Installing OpenJDK with the MSI installer
This procedure describes how to install OpenJDK 11 for Windows using the MSI-based installer.
Procedure
- Download the MSI-based installer of OpenJDK 11 for Windows.
- Run the installer for OpenJDK 11 for Windows.
-
Click
Next
on the welcome screen. -
Check
I accept the terms in license agreement
, then clickNext
. -
Click
Next
. - Accept the defaults or review the optional properties.
-
Click
Install
. -
Click
Yes
on theDo you want to allow this app to make changes on your device?
. Verify the OpenJDK 11 for Windows is successfully installed, run
java -version
command in the 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)
Chapter 5. OpenJDK MSI installer components
(Optional) Set the following OpenJDK 11 for Windows MSI-based installer components:
- jdk
- Java Development Kit (JDK) files.
- jdk-registry-standard
Registry keys:
HKLM\Software\JavaSoft\JDK\<version>, entries: JavaHome: <INSTALLDIR> RuntimeLib: <INSTALLDIR>\bin\server\jvm.dll HKLM\Software\JavaSoft\JDK, entries: CurrentVersion: <version>
- jdk_env_path
-
Appends
<INSTALLDIR>\bin
to the system%PATH%
environment variable. - jdk_env_java_home
-
Sets
<INSTALLDIR>
to the system%JAVA_HOME%
environment variable. - jdk_env_vendor_java_home
-
Sets
<INSTALLDIR>
to the system%REDHAT_JAVA_HOME%
environment variable. - jdk_registry_jar
- Association for JAR files. Launch JAR files with the OpenJDK context menu.
- jmc
-
JDK Mission Control files, installed into
<INSTALLDIR>\missioncontrol
. - jmc_env
-
Appends
<INSTALLDIR>\missioncontrol
to the system%PATH%
environment variable.
Appendix A. MSI-based installer properties
The OpenJDK 11 for Windows MSI-based installer includes the JDK Files component and the following optional properties:
Table A.1. OpenJDK 11 for Windows MSI-based installer properties
Property | Description | Default value |
---|---|---|
OpenJDK Runtime - Windows Registry | The following registry keys are set HKLM\Software\JavaSoft\JDK\<version>, entries: JavaHome: <INSTALLDIR> RuntimeLib: <INSTALLDIR>\bin\server\jvm.dll HKLM\Software\JavaSoft\JDK, entries: CurrentVersion: <version> | Yes |
OpenJDK Runtime - Path Variable | Adds the Runtime to the Path variable so it is available from the command line. | Yes |
OpenJDK Runtime - JAVA_HOME System Variable | JAVA_HOME is used by some programs to find the Java runtime. | No |
OpenJDK Runtime - REDHAT_JAVA_HOME System Variable | REDHAT_JAVA_HOME can be used by some programs to find the Red Hat OpenJDK runtime. | No |
OpenJDK Runtime - Jar Files Association | This enables Jar files to be run from within Windows Explorer. | No |
Mission Control - Files | Contains files that are installed in the <installdir>\missioncontrol directory. | No |
Mission Control - Path Variable | Appends <installdir>\missioncontrol to the system PATH environment variable. | No |
Revised on 2021-10-25 12:30:57 UTC