-
Notifications
You must be signed in to change notification settings - Fork 1
Install Java Development Kit ‐ Windows
- Visit the official Java download page: You can download the latest JDK from either Oracle or OpenJDK. Here are two popular options:
- Oracle JDK: Oracle JDK Downloads
- OpenJDK: AdoptOpenJDK or Temurin.
-
Choose the latest JDK version: On the download page, select the latest version (or the version you need) and download the Windows installer.
-
Download the appropriate installer: Choose the .msi installer for Windows x64.
-
Run the installer: Once the download is complete, double-click the .msi file to start the installation process.
-
Follow the installation instructions:
- Choose the installation folder (you can keep the default folder or change it).
- Click Next and complete the installation process.
To ensure your Windows system recognizes the newly installed version of Java, you need to configure the JAVA_HOME
environment variable.
- Open the System Properties window:
- Right-click on This PC on your desktop or in File Explorer, and select Properties.
- Click on Advanced system settings on the left side.
- In the System Properties window, click the Environment Variables... button.
- Add the
JAVA_HOME
variable:
- Under System variables, click New....
- Set the variable name to
JAVA_HOME
. - For the variable value, enter the path to the JDK installation directory. For example:
C:\Program Files\Java\jdk-23
- Click OK to save.
- Add Java to the
PATH
:
- In the System variables section, locate the
Path
variable, then select it and click Edit. - Click New and add the following line at the end:
%JAVA_HOME%\bin
- Click OK to save.
- Open Command Prompt: Press
Windows + R
, typecmd
, and press Enter. - Check the Java version: Run the following command to verify that Java has been installed correctly:
java -version If everything was installed correctly, you will see the version of the newly installed Java. For example:
After completing these steps, the latest version of Java will be installed and correctly configured on your Windows system. You can now start developing or running Java applications without any issues.