JDK 18, the first non-LTS release since JDK 17, has reached its initial release candidate phase as declared by Mark Reinhold, chief architect, Java Platform Group at Oracle. The main-line source repository, forked to the JDK stabilization repository in early December 2021 (Rampdown Phase One), defines the feature set for JDK 18. Critical bugs, such as regressions or serious functionality issues, may be addressed, but must be approved via the Fix-Request process.
The final set of nine new features, in the form of JEPs, can be separated into three categories: Core Java Library, Java Tools and Java Specification. We examine them here and include where some of these new features fall under the auspices of the four major Java projects - Amber, Loom, Panama and Valhalla - designed to incubate a series of components for eventual inclusion in the JDK through a curated merge.
Seven of these new features can be placed into the Core Java Library:
- JEP 400: UTF-8 by Default (
java.nio.charsets
) - JEP 408: Simple Web Server (
java.net
) - JEP 416: Reimplement Core Reflection with Method Handles (
java.lang.reflect
) - JEP 417: Vector API (Third Incubator)
- JEP 418: Internet-Address Resolution SPI (
java.net
) - JEP 419: Foreign Function & Memory API (Second Incubator)
- JEP 421: Deprecate Finalization for Removal (
java.lang
)
Two of these, JEP 417 and JEP 419, provide continued contribution towards fulfilling Project Panama, a project designed to improve and enrich interoperability between the JVM and well-defined "foreign," i.e., non-Java, APIs that will most-likely include interfaces commonly used within C libraries. Introduced in 2014, Project Panama is led by Maurizio Cimadamore, software architect at Oracle. Early-access builds, last updated on January 18, 2022, are based on an incomplete version of JDK 19.
JEP 418 provides continued contribution towards fulfilling Project Loom, a project designed to explore, incubate and deliver Java VM features and APIs built for the purpose of supporting easy-to-use, high-throughput lightweight concurrency and new programming models. This would be accomplished via virtual threads, delimited continuations and tail calls. Introduced in 2018, Project Loom is led by Ron Pressler, consulting member of the technical staff at Oracle. Early-access builds, last updated on February 13, 2022, are based on Build 9 of the JDK 19 early-access builds.
Of the two remaining JEPs:
falls into the second category, Java Tools. This JEP introduces the @snippet
tag for Oracle's Standard Doclet, the well-known Java API documentation utility that produces the default HTML-formatted output. The intent is to simplify the inclusion of example source code in API documentation.
And finally:
can be placed into the Java Specification category. This JEP provides continued contribution towards fulfilling Project Amber, a project designed to explore and incubate smaller Java language features to improve productivity. Introduced in 2017, Project Amber is led by Brian Goetz, Java language architect at Oracle.
As per the release schedule, March 22, 2022 is the formal release date of JDK 18.
JDK 19
Scheduled for a GA release in September 2022, there are no targeted JEPs for JDK 19 at this time. However, based on recent JEP drafts, JEP candidates, and the Inside Java Newscast #18 (Java’s Plans for 2022) by Nicolai Parlog, Java developer advocate at Oracle, we can surmise which JEPs have the potential to be included in JDK 19.
Project Valhalla, a project designed to explore and incubate advanced JVM and Java language feature candidates. This would include value types, generic specialization and enhanced volatiles. Launched in 2014, Project Valhalla is also led by Brian Goetz. Early-access builds, last updated on August 30, 2019, are very limited at the moment, however activity within this project has increased over the past year.
Plans for Project Valhalla in 2022 include: value classes (JEP Draft 8277163, Value Objects (Preview)); primitive classes (JEP 401, Primitive Classes (Preview) and JEP 402, Classes for the Basic Primitives (Preview)); and universal generics (JEP Draft 8261529, Universal Generics (Preview)). Developers can learn more about Project Valhalla by reading the three-part series published by Goetz in December 2021:
- State of Valhalla, Part 1: The Road to Valhalla
- State of Valhalla, Part 2: The Language Model
- State of Valhalla, Part 3: The JVM Model
Plans for Project Amber in 2022 include: finalizing patterns in switch (presumably a third preview as a follow-up from JEP 420 and JEP 406, Pattern Matching for switch (Preview), delivered in JDK 17); and introduce additional patterns, such as the deconstruction of records/arrays (JEP 405, Record Patterns (Preview)) and possibly regular classes. Originally named Record Patterns & Array Patterns (Preview), JEP 405 is related to JEP 406.
Plans for Project Panama in 2022 include: migrate current incubating foreign APIs into previews; improve foreign API implementations; decide the future of jextract
, i.e., should it be an independent project with a corresponding repository; and place a hold on the Vector APIs until value and primitive types have been implemented in Project Valhalla. JEP Draft 8280173, Vector API (Fourth Incubator), proposes to incorporate enhancements based on feedback from the Java community to the three preceding JEPs, namely: JEP 338, Vector API (Incubator), delivered in JDK 16; JEP 414, Vector API (Second Incubator), delivered in JDK 17; and JEP 417, Vector API (Third Incubator), that will be delivered in the upcoming GA release of JDK 18.
Plans for Project Loom in 2022 include: finalize JEP Draft 8277131, Virtual Threads (Preview), and JEP Draft 8277129, Structured Concurrency (Incubator); merge these features into the JDK main repository; and further explore how to make highly concurrent apps more debuggable and evolve structured concurrency. JEP Draft 8263012, Scope Locals (Incubator), proposes to enhance the Java API with scope locals, which are dynamically scoped, effectively final, local values. They allow a lightweight form of thread inheritance.
We anticipate that Oracle will start targeting some of these and other JEPs for JDK 19 very soon.