Guides for SE student projects »

Java 17 Installation Guide for Windows Users

This guide explains how to install the Oracle Java 17 JDK on Windows.

Installation

  • Download JDK

    • Go to the Oracle download site here.
    • Choose JDK 17Windows.
    • Download the x64 Installer:

    Go ahead and sign in if you are prompted by Oracle, or register an account if you haven't done so.

    Alternatively, you may also download the JDK 17 x64 installer from another provider that does not require you to sign up. Examples:

  • Install JDK

    • Run the downloaded installer and follow the instructions to complete the installation.
    • Suppose the JDK was installed in the directory C:\Program Files\Java\jdk-17 (this is the default location for Oracle, please check the installation directory within the installer for other distributors).

  • Verify installation by running the java -version command in your terminal (e.g. Command Prompt, PowerShell).

    Windows users: You might need to close and reopen the terminal for it to recognise changes done elsewhere in the computer (e.g., newly-installed software, changed to system variables, etc.)

Switching between Java versions

If you have multiple versions of Java installed, you can switch between them by editing the system environment variables. This involves updating the Path settings to point to your desired JDK version.

  • To see the currently active Java version run the following command in a terminal window,

    java -version
    
  • To switch to a different installed version,

    1. Open the Start Menu by clicking the Start button on your taskbar or pressing the key on your keyboard.
    2. Type environment variables in the search bar and click Edit the system environment variables from the search results:
    3. In the window that opens, click on the Environment Variables button located near the bottom:
    4. Scroll through the "System variables" section to find the Path variable, select it and click Edit.
    5. In the Edit Environment Variable window, you will see a list of paths. These paths represent directories your system searches to find executables like Java.
      • To prioritize a different Java version: Find the path to your desired Java installation (e.g., C:\Program Files\Java\jdk-17\bin) and move it to the top of the list.
      • To add a new Java version: Click "New" and add the path to the bin folder of the Java version you want to use (e.g., C:\Program Files\Java\jdk-11\bin).
    6. Click OK on both Edit Environment Variable and "Environment Variables" windows to save your changes and close the windows.
  • Verify the version change by running the java -version command in a new terminal window:

    Windows users: You might need to close and reopen the terminal for it to recognise changes done elsewhere in the computer (e.g., newly-installed software, changed to system variables, etc.)

  • If you already have a JAVA_HOME system variable defined earlier, you need to update it to point to the JDK of your choice. The procedure is similar to how you changed the Path variable.


Authors: