Skip to content

Install Java Development Kit ‐ Windows

Simon Sai edited this page Sep 18, 2024 · 10 revisions

Step 1: Download JDK (Java Development Kit)

  1. Visit the official Java download page: You can download the latest JDK from either Oracle or OpenJDK. Here are two popular options:
  1. Choose the latest JDK version: On the download page, select the latest version (or the version you need) and download the Windows installer.

  2. Download the appropriate installer: Choose the .msi installer for Windows x64.

Step 2: Install JDK

  1. Run the installer: Once the download is complete, double-click the .msi file to start the installation process.

  2. Follow the installation instructions:

  • Choose the installation folder (you can keep the default folder or change it).
  • Click Next and complete the installation process.

Step 3: Set Up the JAVA_HOME Environment Variable

To ensure your Windows system recognizes the newly installed version of Java, you need to configure the JAVA_HOME environment variable.

  1. 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.
  1. 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.
  1. 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.

Step 4: Verify the Installation

  1. Open Command Prompt: Press Windows + R, type cmd, and press Enter.
  2. 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: image


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.