OpenJDK 8 for Windows Getting Started Guide

OpenJDK 8

Installing and using OpenJDK 8 for Windows

Red Hat Developer Group Documentation Team

Abstract

OpenJDK 8 for Windows is a Red Hat offering for developers on the Microsoft Windows platform. The Getting Started with OpenJDK 8 for Windows guide provides an overview of this product and explains how to install the software and start using it.

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.

Chapter 2. Troubleshooting Java Web Start

The OpenJDK 8 for Windows distribution includes an implementation of the Java Web Start deployment protocol based on the IcedTea-Web open-source project. This implementation of the Java Web Start protocol may not be fully compatible with the proprietary Java Web Start implementation included in the Oracle Java 8 distribution.

To report an issue with your Web Start application, please include the appropriate details from the %LOCALAPPDATA%\RedHat\java-1.8.0-openjdk-[version]\webstart\javaws_last_log.txt log file. Note that this file captures the standard output of your Java Web Start application and can contain confidential information.

Legal Notice

Copyright © 2019 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.