How to install and Use Java JDK 21 Initial Release Candidate



The General Availability (GA) date for Java JDK 21, the latest Long Term Supported (LTS) version of Java is 19th September 2023, which is less than a month from now.

But if you are curious to understand and try out Java 21, you can do so by downloading the latest OpenJDK JDK 21 Release-Candidate builds


Links to OpenJDK JDK 21 Release-Candidates for all Operating Systems


As I make use of an ARM-based M1 Macbook, I downloaded the macOS / AArch64 and extracted the .tz file in my download's folder,

% pwd
/Users/c2ctech/Downloads/jdk-21.jdk/Contents/Home/bin

% ./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)

As the tradition goes, let's try out the "Hello World!" example.

public class HelloWorldJdk21 {

   public static void main(String... args) {

        System.out.println("Hello World from Java JDK 21!");
   }

}
% ./java HelloWorldJdk21.java
Hello World from Java JDK 21!
Java JDK 21 Initial Release Candidate Example
-

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


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