Significant Changes in JDK 19 Release
See JDK 19 Release Notes for additional descriptions of the new features and enhancements, and API specification in JDK 19.
The following are some of the updates in Java SE 19 and JDK 19:
Concurrency Model Update Previews
- Virtual threads are lightweight threads that reduce the effort of writing, maintaining, and debugging high-throughput concurrent applications. This is a preview API. See JEP 425: Virtual Threads (Preview) and Virtual Threads in Java Platform, Standard Edition Core Libraries.
- An API is introduced to simplify multithreaded programming for structured concurrency. Structured concurrency treats multiple tasks running in different threads as a single unit of work, thereby streamlining error handling and cancellation, improving reliability, and enhancing observability. See JEP 428: Structured Concurrency (Incubator).
Language Changes
- Record Patterns is introduced as a preview feature for this release. A record pattern consists of a type, a record component pattern list used to match against the corresponding record components, and an optional identifier. You can nest record patterns and type patterns to enable a powerful, declarative, and composable form of data navigation and processing. See JEP 405: Record Patterns (Preview) and Record Patterns in Java Platform, Standard Edition Java Language Updates.
- The preview feature Pattern Matching for
switch
Expressions and Statements has been re-previewed in this release. This feature enables an expression to be tested against a number of patterns, each with a specific action, so that complex data-oriented queries can be expressed concisely and safely. See JEP 427: Pattern Matching for switch (Third Preview) and Pattern Matching for switch Expressions and Statements in Java Platform, Standard Edition Java Language Updates.
Library Changes
- The Foreign Function and Memory API enables Java programs to interoperate with code and data outside the Java runtime. This API enables Java programs to call native libraries and process native data without the brittleness and danger of JNI. The API invokes foreign functions, code outside the JVM, and safely accesses foreign memory that is not managed by the JVM. This is a preview API. See JEP 424: Foreign Function & Memory API (Preview) and Foreign Function and Memory API in Java Platform, Standard Edition Core Libraries.
- The Vector API is introduced to express vector computations that reliably compile at runtime to optimal vector instructions on supported CPU architectures, thus achieving performance superior to equivalent scalar computations. See JEP 426: Vector API (Fourth Incubator).
Removed APIs, Tools, and Components
For more details on removals and deprecations, see Features and Options Deprecated in JDK 19.
In addition, there are security related updates that you need to be aware of. See Security Updates in JDK 19.