Windows
Using the Official Oracle Installer
- Visit the Oracle Java Downloads page
- Download the Windows installer (.exe or .msi) for Java 17
- Run the downloaded installer and follow the installation wizard
- Verify the installation by opening Command Prompt and running:
java -version
Using OpenJDK
- Visit Adoptium (formerly AdoptOpenJDK)
- Download the Windows installer for OpenJDK 17
- Run the installer and follow the installation wizard
- Verify the installation by opening Command Prompt and running:
java -version
Using Chocolatey Package Manager
If you have Chocolatey installed:
choco install openjdk17
java -version
Setting JAVA_HOME
- Right-click on This PC or My Computer and select Properties
- Click on Advanced system settings
- Click the Environment Variables button
- Under System variables, click New
- Enter JAVA_HOME as the variable name
- Enter the path to your Java installation (e.g.,
C:\Program Files\Java\jdk-17) as the variable value - Click OK to close all dialogs
- Verify by opening a new Command Prompt and running:
echo %JAVA_HOME%