Oracle has announced the availability of Java 20, the latest version of the world’s number one programming language and development platform. Java 20 (Oracle JDK 20) delivers thousands of performance, stability, and security improvements, including platform enhancements that will help developers improve productivity and drive innovation and growth across their organizations.
“For more than 25 years, Java has empowered developers to design and build the next generation of robust, scalable, and secure applications,” said Georges Saab, senior vice president of development, Java Platform and chair, OpenJDK Governing Board, Oracle. “The innovative new enhancements in Java 20 reflect the vision and invaluable efforts the global Java community has contributed throughout Java’s existence. With the support provided by Oracle’s ongoing Java technology leadership and community stewardship, Java has never been more relevant as a contemporary language and platform that helps developers improve productivity.”
The latest Java Development Kit (JDK) provides updates and improvements with seven JDK Enhancement Proposals (JEPs). The majority of the updates are follow-up features improving on functionality introduced in earlier releases.
JDK 20 delivers language improvements from OpenJDK project Amber (Record Patterns and Pattern Matching for Switch); enhancements from OpenJDK Project Panama to interconnect Java Virtual Machine (JVM) and native code (Foreign Function & Memory API and Vector API); and features related to Project Loom (Scoped Values, Virtual Threads, and Structured Concurrency), which will dramatically streamline the process of writing, maintaining, and observing high-throughput, concurrent applications.
“Organizations today face increasing pressure to use their resources as wisely and efficiently as possible, which requires developers to seek tools that streamline application development while helping ensure their organizations achieve their IT security and compliance goals,” said Jay Lyman, senior research analyst, S&P Global Market Intelligence. “Digital transformation leaders say they’re more focused on improving time to market and the agility that can be gained with better tools that can accelerate their organization’s application development initiatives.”
Oracle delivers new Java feature releases every six months via a predictable release schedule. This cadence provides a steady stream of innovations, while delivering continuous improvements to the platform’s performance, stability, and security that help increase Java’s pervasiveness across organizations and industries of all sizes.
The most significant updates delivered in Java 20 are:
Language Updates and Improvements
- JEP 432: Record Patterns (Second Preview):Enhances the Java language by allowing users to nest record patterns and type patterns to create a powerful, declarative, and composable form of data navigation and processing. This helps increase developer productivity by enabling them to extend pattern matching to allow for more sophisticated and composable data queries.
- JEP 433: Pattern Matching for Switch (Fourth Preview):By extending pattern matching to switch, an expression can be tested against a number of patterns—each with a specific action—so that complex data-oriented queries can be expressed concisely and safely. Expanding the expressiveness and applicability of switch expressions and statements helps increase developer productivity.
Project Loom Preview/Incubator Features
- JEP 429: Scoped Values (Incubator):Enables the sharing of immutable data within and across threads, which are preferred to thread-local variables – especially when using large numbers of virtual threads. This increases ease-of-use, comprehensibility, robustness, and performance.
- JEP 436: Virtual Threads (Second Preview):Significantly streamline the process of writing, maintaining, and observing high-throughput, concurrent applications by introducing lightweight virtual threads to the Java Platform. By enabling developers to easily troubleshoot, debug, and profile concurrent applications with existing JDK tools and techniques, virtual threads help accelerate application development.
- JEP 437: Structured Concurrency (Second Incubator):Simplifies multithreaded programming by treating multiple tasks running in different threads as a single unit of work. This helps development teams streamline error handling and cancellation, improve reliability, and enhance observability.
Project Panama Preview Features
- JEP 434: Foreign Function & Memory API (Second Preview):Enables Java programs to interoperate with code and data outside of the Java runtime. By efficiently invoking foreign functions (i.e., code outside the Java Virtual Machine [JVM]), and by safely accessing foreign memory (i.e., memory not managed by the JVM), this feature enables Java programs to call native libraries and process native data without requiring the Java Native Interface. This increases ease-of-use, performance, and safety.
- JEP 438: Vector API (Fifth Incubator):Expresses vector computations that reliably compile at runtime to vector instructions on supported CPU architectures. This increases performance compared to equivalent scalar computations.
The Java 20 release is the result of extensive collaboration between Oracle engineers and other members of the worldwide Java developer community via OpenJDK and the Java Community Process (JCP). In addition to the new enhancements, Java 20 is supported by Java Management Service – an Oracle Cloud Infrastructure (OCI) native service – which provides a single pane of glass to help organizations manage Java runtimes and applications on-premises or on any cloud.