Posted On: Sep 21, 2023
Amazon Corretto 21 is now generally available. This Long Term Support (LTS) version supports the latest Java release, OpenJDK 21, and is available on Linux, Windows, and macOS. You can download Corretto 21 from our downloads page.
Some highlights of OpenJDK 21 include:
- Virtual Threads. Lightweight threads not bounded by OS threads.
- DNS stale caching. Reuses stale data to improve DNS resolver resiliency.
- Generational ZGC. Extension to Z Garbage Collector to maintain separate object generations.
- Record Patterns and Pattern Matching for Switch. New record-based objects and switch expressions.
- Sequenced Collections. These new interfaces represent collections with a defined encounter order.
- Key Encapsulation Mechanism API. An encryption technique for securing symmetric keys using public key cryptography.
There are also several preview features in OpenJDK 21:
- Foreign Function & Memory (FFM). An easier, cleaner and safer way to interoperate with native code.
- Structured Concurrency. Treats groups of related tasks running in different threads as a single unit of work.
- Vector API. Provides performance improvements using optimal vector instructions on supported CPU architectures.
- Scoped Values. Values may be safely and efficiently shared to methods without using method parameters.
- Unnamed Classes and Instance Main Methods. Makes it easier to get started with Java.
- String Templates. Couples literal text with embedded expressions and template processors to produce specialized results.