Advertisment

Oracle Launches Java 22 - Delivers 12 JDK Enhancement Proposals

Oracle has announced the release of Java 22, the most recent iteration of the leading programming language and development platform globally. Java 22 (Oracle JDK 22) introduces numerous enhancements focused on performance, stability, and security.

author-image
DQC Bureau
New Update
Oracle Launches Java 22 -  Delivers 12 JDK Enhancement Proposals

Oracle Java 22

Oracle has announced the release of Java 22, the most recent iteration of the leading programming language and development platform globally. Java 22 (Oracle JDK 22) introduces numerous enhancements focused on performance, stability, and security. These improvements aim to assist developers in enhancing productivity, fostering innovation, and facilitating organizational growth. The updates span various aspects, including enhancements to the Java language, its APIs, performance, and tools bundled within the Java Development Kit (JDK).

Advertisment

“The new enhancements in Java 22 enable more developers to quickly and easily build and deliver feature-rich, scalable, and secure applications to help organizations across the globe grow their businesses,” said Georges Saab, senior vice president, of Oracle Java Platform and chair, OpenJDK governing board. “By delivering enhancements that streamline application development and extend Java’s reach to make it accessible to developers of all proficiency levels, Java 22 will help drive the creation of a wide range of new applications and services for organizations and developers alike.” 

 The most recent JDK incorporates advancements through 12 JDK Enhancement Proposals (JEPs). JDK 22 introduces language enhancements sourced from the OpenJDK Project Amber (including Statements before super[…], Unnamed Variables & Patterns, String Templates, and Implicitly Declared Classes and Instance Main Methods); improvements from Project Panama (Foreign Function & Memory API and Vector API); functionalities associated with Project Loom (Structured Concurrency and Scoped Values); enhancements in core libraries and tools capabilities (Class-File API, Launch Multi-File Source-Code Programs, and Stream Gatherers); and performance enhancements (Region Pinning for G1).

 “After nearly three decades, Java’s ability to support complex development tasks that span a wide range of use cases makes the platform as relevant as it has ever been,” said Arnal Dayaratna, research vice president, of software development, IDC. “Java’s versatility and comprehensive toolset enables it to support the development of production-grade, mission-critical applications at scale, which positions it as a key enabling technology for innovative use cases such as generative AI.” 

Advertisment

Significant updates delivered in Java 22 are:

 Project Amber Features in Oracle Java 22 -

  • JEP 447: Statements before super: This feature grants developers the flexibility to define constructor behavior more freely. By permitting statements unrelated to the instance being created to precede an explicit constructor invocation, it facilitates a more intuitive arrangement of logic that must be incorporated into auxiliary static methods, auxiliary intermediate constructors, or constructor arguments. Furthermore, it maintains the existing guarantee that constructors execute in a top-down manner during class instantiation, thereby ensuring that code within a subclass constructor cannot disrupt superclass instantiation. Moreover, this feature does not necessitate any modifications to the Java Virtual Machine (JVM) and relies solely on the JVM's current capability to verify and execute code appearing before explicit constructor invocations within constructors.
  • JEP 456: Unnamed Variables & Patterns: This enhancement boosts developer efficiency by enriching the Java language with unnamed variables and patterns. These can be utilized in situations where variable declarations or nested patterns are necessary but remain unused. Such a feature minimizes the likelihood of errors, enhances the clarity of record patterns, and enhances the overall maintainability of code.
  • JEP 459: String Templates (Second Preview): This simplification streamlines Java program development by enabling the straightforward expression of strings containing dynamically computed values at runtime. It concurrently enhances program security when constructing strings from user inputs and transmitting them to external systems. Moreover, it improves the readability of expressions intermixed with text and facilitates the creation of non-string values derived from literal text and embedded expressions, eliminating the need for an intermediary string representation.
  • JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview): This feature aids in expediting the learning process by providing an accessible entry point to Java programming, allowing students to write their initial programs without the necessity of comprehending language features tailored for complex programs. It enables educators to introduce concepts progressively, and students can easily craft simplified declarations for single-class programs. As their proficiency develops, they can seamlessly incorporate more advanced features into their programs, fostering a gradual expansion of skills.
Advertisment

Project Loom Features of Java 22-

  • JEP 462: Structured Concurrency (Second Preview): This feature assists developers in refining error handling and cancellation processes while enhancing observability through the introduction of a structured concurrency API. Promoting a concurrent programming style mitigates prevalent risks associated with cancellation and shutdown, such as thread leaks and delays in cancellation. Additionally, it enhances the observability of concurrent code, facilitating better understanding and management of its execution flow.
  • JEP 464: Scoped Values (Second Preview): This feature enhances developers' projects by enabling the sharing of immutable data within and across threads, thereby boosting ease of use, comprehensibility, performance, and robustness.

Project Panama Features

Advertisment
  • JEP 454: Foreign Function & Memory API: This introduction of an API enhances ease-of-use, flexibility, safety, and performance for developers by enabling Java programs to interact with code and data external to the Java runtime. The API facilitates the efficient invocation of foreign functions, including those residing outside the Java Virtual Machine, and provides safe access to foreign memory, which refers to memory not managed by the JVM. Consequently, Java programs can seamlessly call native libraries and handle native data without relying on the Java Native Interface. 
  • JEP 460: Vector API (Seventh Incubator): This feature empowers developers to attain superior performance compared to equivalent scalar computations by introducing an API for expressing vector computations. These computations reliably compile into vector instructions at runtime, leveraging the capabilities of supported CPU architectures.

Core Libraries & Tools Features of Java 22 -

  • JEP 457: Class-File API (Preview): This feature aids developers in enhancing productivity by offering a standardized API for parsing, generating, and transforming Java class files.
  • JEP 458: Launch Multi-File Source-Code Programs: This enhancement allows developers to decide whether and when to configure a build tool. It achieves this by enhancing the Java application launcher to support the execution of a program provided as multiple files of Java source code.
  • JEP 461: Stream Gatherers (Preview): This enhancement aids developers in boosting productivity by expanding the capabilities of the Stream API to accommodate custom intermediate operations. These operations empower stream pipelines to transform data in ways that were previously challenging with only built-in intermediate operations. By enhancing the flexibility and expressiveness of stream pipelines and enabling custom intermediate operations to handle streams of infinite size, this feature enables developers to efficiently read, write, and maintain Java code.
Advertisment

Performance Updates of Oracle Java 22 -

  • JEP 423 Region Pinning for G1: This improvement aids in minimizing latency by permitting certain garbage collection processes to occur during native library calls that would typically require the collector to pause. It accomplishes this by identifying the objects necessitating blocking during these calls to native libraries and selectively "pinning" only the regions containing these objects. As a result, garbage collection can proceed unhindered in unpinned regions, even amidst native library calls that would ordinarily cause blocking.

 The release of Java 22 reflects ongoing collaboration between Oracle and the global Java developer community, facilitated through OpenJDK and the Java Community Process (JCP). Alongside the introduction of new enhancements and features, Java 22 is backed by the Java Management Service (JMS), an Oracle Cloud Infrastructure (OCI) native service.

Advertisment

This service provides a consolidated console and dashboard, aiding organizations in managing Java runtimes and applications across various environments, whether on-premises or in the cloud. For further insights into the features of Java 22, please refer to the technical blog post dedicated to Java 22.

Supporting the Global Java Ecosystem with Innovation in the Cloud

Java achieves heightened performance, efficiency, innovation, and cost-effectiveness when utilized on the Oracle Cloud Infrastructure (OCI), which stands as one of the initial hyperscale clouds to endorse Java 22. Through the provision of Oracle Java SE, Oracle GraalVM, and the Java SE Subscription Enterprise Performance Pack at no cost on OCI, Java 22 empowers developers to create and deploy applications that exhibit enhanced speed, quality, and cost-effectiveness.

Advertisment

The Oracle Java Universal SE Subscription is a pay-as-you-go offering that provides customers with best-in-class support. It includes triage support for the entire Java portfolio, entitlement to GraalVM, the Java SE Subscription Enterprise Performance Pack, access to the advanced features of the Java Management Service, and the flexibility to upgrade at the pace of their businesses. This helps IT organizations manage complexity, contain costs, and mitigate security risks. 

JavaOne Returns in 2025

The flagship event for the global Java community, JavaOne, will return to the San Francisco Bay Area in 2025. Taking place from March 17-20, 2025 in Redwood Shores, California, JavaOne 2025 will allow attendees to hear about the latest Java developments and interact with Oracle’s Java experts and industry luminaries. Read more via the blog post on Inside Java.

Supporting Quotes by TJC, xHub, JetBrains, and Oracle

“Within the dynamic ecosystem of the Türkiye Java Community (TJC), Oracle’s enduring support fuels our momentum,” said Evren Tan, community lead, TJC. “As Java 22 unfolds, we are embracing an array of contemporary features that further enhance developer efficiency, bolstering our commitment to advancing Java technology in Türkiye. We also welcome Java developers worldwide to join us in TJC activities, showcasing the welcoming community spirit that keeps Java vibrant.”

“Java’s popularity as a programming language, platform, and developer community continues to grow in Morocco and the African region,” said Badr El Hourari, founder and CIO, of xHub. “With Java 22, I’m excited to see Oracle’s Java team focus on innovation that will help the new developers adopt Java more quickly such as with JEP 463. By simplifying the language, the on-ramp to Java becomes easier for a whole new generation of programmers. Also, here in Morocco, we continue to highlight the importance of Java at the annual Devoxx Morocco conference, and we welcome all developers to attend this year’s event on October 2-4 to hear from some of the most influential global voices in the Java community.”

 “It amazes me to see Java 22 bundle features for all – from students to senior developers, and adventurous Java enthusiasts to organizations looking for stability with performance,” said Mala Gupta, Java developer advocate, JetBrains. “Java is embracing a minimalist approach by continuing to reduce ceremonies around writing initial steps of code, via instance main method and implicit classes, making it easier for folks to get started learning Java. With the constructor makeover (statements before super[…]), Java has proven again that it supports responsible innovation, and relaxing language constraints that existed from Java’s version 1.0 without breaking any existing code is very exciting. IntelliJ IDEA 2024.1 is ready with its support for Java 22 features to enable Java developers to use them with ease.”

 “The Helidon team recognized the value of virtual threads as soon as they were announced. With Helidon 4, the team rewrote the Helidon web server to natively use virtual threads, which resulted in much better performance and increased developer productivity,” said Tom Snyder, vice president of engineering, enterprise cloud-native Java, Oracle. “Now with Java 22 we are seeing another performance boost for virtual threads, and these significant improvements will benefit all Helidon users," he concluded.

oracle Java 22 JDK
Advertisment