Oracle has announced the general availability of Java 14. JDK 14 delivers new features, including two new highly anticipated preview features, Pattern Matching for instanceof (JEP 305) and Records (JEP 359), as well as the second preview of Text Blocks (JEP 368).
Some of the new features included in Java 14
The newest Java release also adds Java language support for switch expressions, exposes new APIs for continuous monitoring of JDK Flight Recorder data, extends the availability of the low-latency Z Garbage Collector to macOS and Windows, and adds, in incubator modules. The packaging of self-contained Java applications and a new Foreign memory access API for safe, efficient access to memory outside of the Java heap.
- JEP 305: Pattern Matching for instanceof (Preview): This preview feature enhances Java with pattern matching for the instanceof operator. This improves developer productivity by eliminating the need for common boiler plate code and allows a more concise type-safe code.
- JEP 343: Packaging Tool (Incubator): Provides a way for developers to package Java applications for distribution in platform-specific formats. This helps developers with modern applications where constraints require runtimes and applications to be bundled in a single deliverable. This tool is introduced in an incubator module, which is a way of putting non-final APIs and non-final tools in the hands of developers to get their feedback while the APIs/tools progress towards either finalization or removal in a future release.
- JEP 345: NUMA-Aware Memory Allocation for G1: Improves the overall performance of the G1 garbage collector on non-uniform memory access (NUMA) systems.
- JEP 349: JFR Event Streaming: Exposes JDK Flight Recorder (JFR) data for continuous monitoring. This will simplify access to JFR data for various tools and applications and spur further innovation.