JDK 19 / Java 19 Official GA
JDK 19 / Java 19 has been officially released.
The new release contains a total of 7 new JEPs.
- 405: Record Patterns goes to preview stage
Record Patterns deconstructs the values of record, and Record patterns and Type patterns enable powerful, declarative, composable forms of data navigation and processing through nesting.
This feature is currently in preview.
- 422: Porting the JDK to Linux/RISC-V Platforms
Currently only the RV64GV configuration for RISC-V is supported, which is a generic 64-bit ISA. support for other RISC-V configurations, such as a generic 32-bit configuration (RV32G), will be considered in the future.
- 424: Foreign Function & Memory API goes into preview
This API allows Java programs to interoperate with code and data outside of the Java runtime. By efficiently calling external functions (i.e., code outside the JVM) and safely accessing external memory (i.e., memory not managed by the JVM), this API enables Java programs to call native libraries and work with native data without the danger and vulnerability of JNI.
In a nutshell: This feature makes it easier and more efficient for Java to call ordinary native code.
- 425: Virtual Threads Goes to Preview
Introducing virtual threads for Java, virtual threads are JDK implementations of lightweight threads that have proven useful in other multi-threaded languages, such as Goroutine in Go and processes in Erlang. Virtual threads avoid the extra expense of context switching, take into account the benefits of multithreading, simplify the complexity of highly concurrent programs, and can effectively reduce the effort of writing, maintaining, and observing high-throughput concurrent applications.
- 426: Vector API Enters Incubation Phase 4
Vector computation consists of a set of operations on vectors. The Vector API is used to express a vector computation that can be reliably compiled at runtime to the best vector instructions on the supported CPU architecture, thus achieving better performance than the equivalent scalar computation. The goal of the vector API is to provide users with clean, easy-to-use and platform-independent expression of a wide range of vector computations.
- 427: Pattern Matching for switch goes to Preview Phase 3
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 testing expressions against a number of patterns so that complex data-oriented queries can be expressed concisely and safely.
- 428: Structured Concurrency Enters Incubation Phase
JDK 19 introduces Structured Concurrency, a multi-threaded programming approach intended to simplify multi-threaded programming with the Structured Concurrency API, not to replace java.util.concurrent, and is currently in the incubation phase.
Structured concurrency treats multiple tasks running in different threads as a single unit of work, thereby simplifying error handling, improving reliability, and enhancing observability. That is, structured concurrency preserves the readability, maintainability, and observability of single-threaded code.