Chapter 1. Getting Started with OpenJDK 8 for Windows

OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE).

OpenJDK 8 for Windows provides a distribution of OpenJDK that follows the Red Hat Enterprise Linux distribution of OpenJDK as closely as possible on the Microsoft Windows platform. Windows builds use Red Hat Enterprise Linux RPM sources and apply all of the relevant RPM patches.

OpenJDK 8 for Windows includes OpenJDK, fonts, timezone data, and CA certificates from Red Hat Enterprise Linux.

1.1. OpenJDK 8 for Windows Installation Options

OpenJDK 8 for Windows can be installed manually using a ZIP bundle or through a graphical user interface using an MSI-based installer.

Depending on your circumstance, use one of the following installation methods:

1.2. Installing OpenJDK with the ZIP Bundle

To manually install OpenJDK 8 for Windows using the ZIP bundle:

  1. Download the ZIP bundle of OpenJDK 8 for Windows.
  2. Extract the contents of the ZIP bundle to a directory of your choice.

    Note

    Extracting the contents of the ZIP bundle to a directory path that does not contain spaces is recommended.

  3. Add the bin directory contained in your OpenJDK 8 for Windows installation path to the %PATH% environment variable:

    C:\> setx /m PATH "%PATH%;C:\Progra~1\RedHat\java-1.8.0-openjdk-1.8.0.181-1\bin"

    If the path contains spaces, use the shortened path name.

  4. Restart Command Prompt to reload the environment variables.

The %JAVA_HOME% environment variable must also be set to use some developer tools. Set the %JAVA_HOME% environment variable as follows:

  1. Open Command Prompt as an administrator.
  2. Set the value of the environment variable to your OpenJDK 8 for Windows installation path:

    C:\> setx /m JAVA_HOME "C:\Progra~1\RedHat\java-1.8.0-openjdk-1.8.0.181-1"

    If the path contains spaces, use the shortened path name.

  3. Restart Command Prompt to reload the environment variables.

1.3. Installing OpenJDK with the MSI Installer

To install OpenJDK 8 for Windows using the MSI-based installer:

  1. Download the MSI-based installer of OpenJDK 8 for Windows for your architecture.
  2. Run the installer and follow the on-screen instructions to install OpenJDK 8 for Windows and the desired extra components.

The %JAVA_HOME% environment variable must also be set to use some developer tools. Set the %JAVA_HOME% environment variable as follows:

  1. Open Command Prompt as an administrator.
  2. Set the value of the environment variable to your OpenJDK 8 for Windows installation path:

    C:\> setx /m JAVA_HOME "C:\Progra~1\RedHat\java-1.8.0-openjdk-1.8.0.181-1"

    If the path contains spaces, use the shortened path name.

  3. Restart Command Prompt to reload the environment variables.

1.3.1. OpenJDK MSI Installer features

The OpenJDK 8 for Windows MSI-based installer includes the following features:

jdk
Runtime environment files (excluding development tools).
jdk_devel
Java Development Kit files.
jdk_registry_standard

Registry keys:

HKLM\Software\JavaSoft\Java Runtime Environment, entries:
  CurrentVersion: 1.8

HKLM\Software\JavaSoft\Java Runtime Environment\1.8, entries:
  JavaHome: <INSTALLDIR>\jre\
  RuntimeLib: <INSTALLDIR>\jre\bin\server\jvm.dll

HKLM\Software\JavaSoft\Java Runtime Environment\1.8_<update>, entries:
  JavaHome: <INSTALLDIR>\jre\
  RuntimeLib: <INSTALLDIR>\jre\bin\server\jvm.dll
jdk_registry_standard_devel

Registry keys:

HKLM\Software\JavaSoft\Java Development Kit, entries:
  CurrentVersion: 1.8

HKLM\Software\JavaSoft\Java Development Kit\1.8, entries:
  JavaHome: <INSTALLDIR>
  RuntimeLib: <INSTALLDIR>\jre\bin\server\jvm.dll

HKLM\Software\JavaSoft\Java Development Kit\1.8_<update>, entries:
  JavaHome: <INSTALLDIR>
  RuntimeLib: <INSTALLDIR>\jre\bin\server\jvm.dll
jdk_env_path
Appends <INSTALLDIR>\bin and <INSTALLDIR>\jre\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 using the OpenJDK context menu.
webstart
WebStart files, installed into <INSTALLDIR>\webstart.
webstart_registry
Association for JNLP files and jnlp:// URLs.
webstart_env
Appends <INSTALLDIR>\webstart to the system %PATH% environment variable.
webstart_migrate
Migrate WebStart local settings and cache on update.