Steps to Install Java 21 (LTS JDK) on Windows 11


Java 21 is the lastest LTS version.


Below are the steps to install Java 21 JDK on Windows 11 PC.

    Note: We will be installing Oracle OpenJDK Java 21 Standard Edition (SE)

    1. Go to the official Oracle OpenJDK Download page for Java 21 - https://jdk.java.net/java-se-ri/21
    2. Download the setup: Windows 11 x64 Java Development Kit. This will download a zip file - openjdk-21_windows-x64_bin.zip
      Windows 11 x64 Java Development Kit
    3. Now create a Java-21 folder under C:\Program Files and extract the jdk-21 zip file in it.
    4. Now we add the path of the Java 21 bin folder - "C:\Program Files\Java-21\jdk-21\bin" to the PATH variable in environment settings.
      Windows 11 Environment Variable PATH Java 21
    5. Open Command Prompt and try out the java --version command.
      java --version
      
      openjdk212023-69-19
      OpenJDK Runtime Environment (build 21+35-2513)
      OpenJDK 64-Bit Server VM (build 21+35-2513, mixed mode, sharing)
      Java 21 running on Windows 11

Thats all!

Note: If you have multiple Java JDKs installed on your PC, you may want to also set JAVA_HOME

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap