Skip to content
  • There are no suggestions because the search field is empty.

How-To: Configure JAVA_HOME and update System Path for JRE

What Does This Article Cover? This guide provides detailed instructions on setting the JAVA_HOME environment variable and updating the Path system variable to ensure your system uses Java Runtime Environment (JRE). Correct configuration of these variables is crucial for running Java applications smoothly.

  • Setting the JAVA_HOME variable

  • Updating the System PATH

  • Verifying the Installation

  • Other Related Material

Setting the JAVA_HOME Variable

  1. Access System Properties:

    • Open the Start Menu and type env.
    • Select Edit the system environment variables.
  2. Navigate to Environment Variables:

    • In the System Properties window, click the Environment Variables button.
  3. Create JAVA_HOME Variable:

    • In the Environment Variables window, under the System variables section, click New.
    • Enter JAVA_HOME as the variable name.
    • For the variable value, enter the path to your JRE installation directory. Ensure the JRE version is numbered is version 21 or higher.
    • Click OK to save the variable.

Updating the System PATH

  1. Edit the Path Variable:

    • In the same Environment Variables window, under the System variables section, find and select the Path variable. Click Edit.
  2. Add JAVA_HOME to Path:

    • Click New and add %JAVA_HOME%\bin to the entries list.
    • Move this new entry above any other Java-related entries in the list to prioritize it.
    • Click OK to close all dialog boxes.

Verifying the Installation

  1. Open Command Prompt:

    • Open a new command prompt window.
  2. Check Java Version:

    • Type java -version and press Enter. Confirm that the version displayed is within the specified range (version 21 or higher).
    • Type javac -version and press Enter. Verify that this version also falls within the acceptable range.

Other Related Material