7 New Features of JDK 19
The JDK 19 feature set is currently frozen, and Java 19 is expected to be officially released in September of this year. Take a look at these 7 new frozen features of JDK 19.
Record Patterns (Preview)
Enhance the Java programming language to deconstruct record values with Record Patterns, which can nest record patterns and type patterns to enable powerful, declarative, and composable forms of data navigation and processing.
This is a preview language feature.
Linux/RISC-V porting
Porting the JDK to Linux/RISC-V currently only supports the RV64GV configuration of RISC-V (generic 64-bit ISA containing vector instructions). Support for other RISC-V configurations, such as the generic 32-bit configuration (RV32G), may be considered in the future.
Foreign Function & Memory API (preview)
Introduces an API through which Java programs can interoperate with code and data outside of the Java runtime. This API enables efficient calls to external functions (code outside the JVM) and safe access to external memory (memory not managed by the JVM), allowing Java programs to call native libraries and work with native data without the vulnerabilities and dangers of JNI.
This is a preview API.
Virtual Threads (Preview)
Introduces virtual threads to the Java platform. Virtual threads are lightweight threads that significantly reduce the effort of writing, maintaining, and observing high-throughput concurrent applications.
Virtual threads have been covered in previous blogs. It will not be repeated here.
Vector API (fourth incubation)
Introduce an API to express vector computation that compiles reliably at runtime, optimizing vector instructions on supported CPU architectures to achieve better performance than scalar computation.
Switch Pattern Matching (3rd Preview)
Enhance the Java programming language with pattern matching for switch expressions and statements, and extensions to the pattern language. Extending pattern matching to switch allows expressions to be tested against a number of patterns so that complex data-oriented queries can be expressed concisely and safely.
This feature first appeared in Java 17 as a preview, and Java 19 as a third preview.
Structured Concurrency (incubation phase)
Introduced to simplify multi-threaded programming, Structured Concurrency treats multiple tasks running in different threads as a single unit of work, simplifying error handling, improving reliability, and enhancing observability.
This is an incubation stage API.