The latest version of Java has been released by Oracle. Java 19 includes a number of updates related to performance, stability, and security.
The most significant improvements to the language itself are the ability to nest record patterns and pattern matching for switch expressions, both of which are currently in preview. The record patterns update extends pattern matching and allows for more composable data queries. Pattern matching for switch expressions allows an expression to be tested against multiple patterns.
New library tool updates include an API for invoking foreign functions and safely accessing foreign memory, which enables Java programs to call native libraries and process native data using a Java development model. A new Vector API allows Java programs to express vector computations that compile at runtime to vector instructions.
Project Loom, which is an attempt to provide a lightweight concurrency model for Java, has also resulted in a few new features. Virtual threads significantly reduce the effort of writing, maintaining, and observing high-throughput concurrent applications. Structured concurrency will simplify multithreaded programming by treating multiple tasks running in different threads as a single unit.
And finally, the Linux/RISC-V Port has been integrated into the JDK mainline repository, which will make Linux/RISC-V implementations easier in the future.
“Our ongoing collaboration with the developer community is the lifeblood of Java. As the steward of Java, Oracle is steadfastly committed to providing developers and enterprises with the latest tools to help them create innovative apps and services,” said Georges Saab, senior vice president of development for the Java Platform and chair of the OpenJDK Governing Board at Oracle. “The powerful new enhancements in Java 19 are a testament to the monumental work across the global Java community.”