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

Install JDK
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.)
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,
Start button on your taskbar or pressing the key on your keyboard.environment variables in the search bar and click Edit the system environment variables from the search results:
Environment Variables button located near the bottom:
Path variable, select it and click Edit.
Edit Environment Variable window, you will see a list of paths. These paths represent directories your system searches to find executables like Java.
C:\Program Files\Java\jdk-17\bin) and move it to the top of the list.
C:\Program Files\Java\jdk-11\bin).
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: