Oracle says the latest Java Development Kit (JDK) provides updates and improvements with 15 JDK Enhancement Proposals (JEPs). JDK 21 delivers language improvements from OpenJDK Project Amber (String Templates, Record Patterns, Pattern Matching for Switch, Unnamed Patterns and Variables, and Unnamed Classes and Instance Main Methods); enhancements from Project Panama (Foreign Function & Memory API and Vector API); features related to Project Loom (Virtual Threads, Scoped Values, and Structured Concurrency); performance updates (Generational ZGC); and maintenance and deprecation features (Deprecate the 32-bit x86 Port for Removal, and Prepare to Disallow the Dynamic Loading of Agents).
Highlights of the release include Virtual Threads (to streamlines the process of writing, maintaining, and observing high-throughput, concurrent applications, improvements to the Z Garbage Collector (ZGC) to maintain separate generations for young and old objects, Pattern Matching for Switch (makes switch expressions and statements more widely applicable by allowing patterns to appear in case labels, while safety is increased by requiring that pattern switch statements cover all possible input values
It also includes two preview features from Project Panama.
|
The third preview of the Foreign Function & Memory API introduces an API to enable Java programs to interoperate with code and data outside of the Java runtime without requiring Java Native Interfacee.
The sixth incubator version of Vector API introduces an API to express vector computations that reliably compile at runtime to vector instructions on supported CPU architectures.
Java 21 is supported by Java Management Service, an Oracle Cloud Infrastructure (OCI) native service that helps manage Java runtimes and applications on-premises or on any cloud.
"Java continues to be the language and platform of choice for the development of robust, scalable, and secure applications used by organisations and millions of individuals around the world," said Oracle Java Platform senior vice president and OpenJDK governing board chair Georges Saab.
"The new enhancements in Java 21 enable developers to build better applications even faster than before. In addition, commercial support will be available for at least eight years to enable customers to migrate at their own pace."
That eight years of support means customers will be able to keep applications in production longer with minimal maintenance.
Oracle Java SE, Oracle GraalVM, and the Java SE Subscription Enterprise Performance Pack are available free of charge on OCI.
The pay-as-you-go Oracle Java Universal SE Subscription provides support, including triage support for the entire Java portfolio, entitlement to GraalVM, the Java SE Subscription Enterprise Performance Pack, and access to the advanced features of the Java Management Service.
In related news, Oracle has extended long term support for Java 11 until at least January 2032, representing eight more years of support and updates.