Setting Up VS Code with Java JDK 21

The Java JDK 21 (Final Release Candidate) can be setup downloaded and installed on your computer by following the article.

Once the installation is done, you need to set this as the JAVA_HOME.

Finally we are all set to use JDK 21 with VS Code.

public class Hello {

    public static void main(String... args) {
        System.out.println("Hello JDK 21!");
Macbook % java -version
openjdk 21 2023-09-19
OpenJDK Runtime Environment (build 21+35-2513)
OpenJDK 64-Bit Server VM (build 21+35-2513, mixed mode, sharing)
Macbook % /us/bin/env/Users/code2care/Downloads/jdk-21. jdk/Contents/Home/bin/java -XX:
+ShowCodeDetailsInExceptionMessages -cp /private/var/folders/5k/80h7br711xqctwe_33dv9z2w0
000gn/T/vscodesws_91146/jdt_ws/ Hello
Hello JDK 21!
Hello JDK 21 Example with VS Code

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

Author: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

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