Chapter 5. New features for the Red Hat build of OpenJDK 21

The initial release of Red Hat build of OpenJDK 21 includes new features that enhance the use of your Java applications.

Red Hat build of OpenJDK 21 includes the following new features:

UTF-8 by default
For more information, see JEP 400: UTF-8 by Default.
Simple web server
For more information, see JEP 408: Simple Web Server.
Code snippets in Java API documentation
For more information, see JEP 413: Code Snippets in Java API Documentation.
Reimplement core reflection with method handles
For more information, see JEP 416: Reimplement Core Reflection with Method Handles.
Internet-address resolution SPI
For more information, see JEP 418: Internet-Address Resolution SPI.
Linux/RISC-V port
For more information, see JEP 422: Linux/RISC-V Port.
Scoped values (Preview feature)
For more information, see JEP 429: Scoped Values (Preview).
String templates (Preview feature)
For more information, see JEP 430: String Templates (Preview).
Sequenced collections
For more information, see JEP 431: Sequenced Collections.
Generational Z Garbage Collector (ZGC)
For more information, see JEP 439: Generational ZGC.
Record patterns
For more information, see JEP 440: Record Patterns.
Pattern matching for switch
For more information, see JEP 441: Pattern Matching for switch.
Foreign function and memory (FFM) API (Third preview)
For more information, see JEP 442: Foreign Function & Memory API (Third Preview).
Unnamed patterns and variables (Preview feature)
For more information, see JEP 443: Unnamed Patterns and Variables (Preview).
Virtual threads
For more information, see JEP 444: Virtual Threads.
Unnamed classes and instance main methods (Preview feature)
For more information, see JEP 445: Unnamed Classes and Instance Main Methods (Preview).
Scoped values (preview)
For more information, see JEP 446: Scoped Values (Preview).
Vector API (sixth incubator)
For more information, see JEP 448: Vector API (Sixth Incubator).
Key encapsulation mechanism API
For more information, see JEP 452: Key Encapsulation Mechanism API.
Structured concurrency (Preview feature)
For more information, see JEP 453: Structured Concurrency (Preview).