Search

Chapter 1. Selecting a specific Red Hat build of OpenJDK from the installed versions for an application

download PDF

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

  1. Log in as a Windows system administrator.
  2. On the command line, set the prompt to C:/.
  3. Enter dir /b /s java.exe to list all of the installed OpenJDKs on the system.
  4. 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.

  5. Restart Command Prompt to reload the environment variables.
  6. Retrieve the value of the path variable:

    echo %JAVA_HOME%
  7. Set the value of path variable:

    setx -m PATH "%PATH%;%JAVA_HOME%\bin";
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.