The Arrival of Java 18!
Dalibor Topić on March 22, 2022Follow Java and OpenJDK on Twitter.
Oracle is proud to announce the general availability of JDK 18. This release is the ninth Feature Release delivered on time through the six-month release cadence. This level of predictability allows developers to easily manage their adoption of innovation thanks to a steady stream of expected changes
Java’s ability to boost performance, stability, and security continues to make it the world’s most popular programming language.
JDK 18 is now available!
Oracle now offers JDK 18 for developers, end-users, and enterprises. Oracle JDK 18 will receive performance, stability and security updates for six-months following the Oracle Critical Patch Update (CPU) schedule as outlined in the Oracle Java SE Support Roadmap.
Oracle JDK 18 is not a long-term support (LTS) release. Oracle JDK 17 (released on September 14, 2021) is the most recent long-term support (LTS) under the release cadence announced in 2018. Oracle has announced plans to shorten the time between future LTS releases, from 3 years to 2 years so the next LTS will be Java 21 in September of 2023.
Another important change announced six months ago was the introduction of a frictionless no-fee license which allows organizations to continue to use Oracle JDK 17 releases, including quarterly performance, stability, and security patches, at no cost. Starting with JDK 17, LTS releases will be made available under the new no-fee license for at least three years, allowing one full year of overlap with the next LTS release. Non-LTS releases, such as JDK 18 and its updates, will also be made available under the new license.
Java SE Subscribers get access to Oracle’s Java SE Support and commercial features such as GraalVM Enterprise, Java Management Service and the Advanced Management Console. See The New Java SE License Terms blog for details on the new license.
Java 18, Together
As with previous releases, with Java 18, we continue to celebrate the contributions from many individuals and organizations in the OpenJDK Community — we all build Java, together!
JDK 18 Fix Ratio
The rate of change over time in the JDK releases has remained largely constant for years, but under the six-month cadence the pace at which production-ready features and improvements are delivered has vastly improved.
Instead of making tens of thousands of fixes and delivering close to one hundred JEPs (JDK Enhancement Proposals) every few years as we did with legacy “Major Releases”, enhancements are delivered in leaner “Feature Releases” on a more manageable, predictable six-month schedule. The changes range from significant new features to small enhancements to routine maintenance, bug fixes, and documentation improvements. Each change is represented in a single commit for a single issue in the JDK Bug System.
Of the 17,253 JIRA issues marked as fixed in Java 11 through Java 18 at the time of their GA, 12,442 were completed by people working for Oracle while 4,811 were contributed by individual developers and developers working for other organizations. JDK 18 delivers the most contributions in a release by Independent individual contributors. This demonstrates OpenJDK as a welcome place not only for organizations but contributors of all types bringing their unique skills into the Java community.
Going through the issues and collating the organization data from assignees results in the following chart of organizations sponsoring the development of contributions in Java:
In Java 18, of the 2,062 JIRA issues marked as fixed, 1261 were completed by Oracle, while 801 were contributed by other members of the Java community including a record 168 from Independent individual contributors.:
Oracle would also like to thank the developers working for organizations like Alibaba, Amazon, ARM, Intel, JetBrains, Red Hat, SAP, and Tencent for their notable contributions. We are also thankful to see contributions from smaller organizations such as Bellsoft, DataDog, Loongson, and independent developers who collectively contributed 13% of the fixes in Java 18.
We are equally grateful to the many experienced developers who reviewed proposed changes, the early adopters who tried out early access builds and reported issues, and the dedicated professionals who provided feedback on the OpenJDK mailing lists.
The following individuals provided invaluable feedback on build quality, logged good quality bugs, or offered frequent updates:
- Jaikiran Pai (Apache Ant)
- Tilman Hausherr (Apache PDFBox)
- Martin Grigorov (Apache Tomcat, Apache Wicket)
- Rafael Winterhalter (Byte Buddy)
- Yoann Rodière (Hibernate ORM, Validator, Search, Reactive)
- Marc Hoffman (JaCoCo)
- David Karnok (RxJava)
Additionally, through the Quality Outreach program we would like to thank the following FOSS (Free and Open Source) projects and individuals who provided excellent feedback on testing Java 18 early access builds to help improve the quality of the release.
- Apache Derby (Rick Hillegas)
- Apache Lucene (Uwe Schindler)
- Apache MyBatis (Iwao Ave)
- Apache Zookeeper (Enrico Olivelli)
- BNYM Code Katas (Rinat Gatyatullin)
- Karate (Peter Thomas)
New in Java 18
Along with thousands of performance, stability and security updates, Java 18 delivers nine enhancements/changes (known as JDK Enhancement Proposals - JEPs), including two delivered in incubator modules and one preview language feature.
Incubator Modules allow putting non-final APIs and non-final tools in the hands of developers and users to gather feedback that will ultimately improve the quality of the Java platform.
Similarly, Preview Features, are fully specified and fully implemented Language or VM Features of the Java SE Platform; and yet impermanent. They are made available in JDK Feature Releases to allow for developer feedback based on real-world uses, before them becoming permanent in a future release. This also affords tool vendors the opportunity to work towards supporting features before they are finalized into the Java SE Standard.
The nine JEPs delivered with Java 18 are grouped into four categories:
1. Core library improvements and updates
JEP 400: UTF-8 by Default
Makes Java programs more predictable and portable when code relies on the default charset; clarifies where the standard Java API uses the default charset and standardizes on UTF-8 throughout the standard Java APIs, except for console I/O.
JEP 408: Simple Web Server
An out-of-the-box static HTTP file server with easy setup and minimal functionality, reducing developer activation energy, making the JDK more approachable, and offering a default implementation via the command line together with a small API for programmatic creation and customization.
You can find out more about the Simple Web Server in the Inside Java podcast #22 with Julia Boes.
JEP 416: Reimplement Core Reflection with Method Handle
Reduces the maintenance and development cost of reflection support for future language features. It also simplifies the Hotspot VM code.
JEP 418: Internet-Address Resolution SPI (Service-provider Interface)
Makes it possible to replace the default operating-system native resolver, which usually results in a blocking operating-system call, with a developer-provided alternate resolver.
2. Tooling improvements
JEP 413: Code Snippets in Java API Documentation
Facilitates the validation and formatting of source code fragments in API documentation. Although correctness is ultimately the responsibility of the author, enhanced support in javadoc and related tools can make it easier to achieve, enabling modern styling, such as syntax highlighting, as well as the automatic linkage of names to declarations, and enabling better Integrated Development Environment (IDE) support for creating and editing snippets.
An introduction video to the Code Snippets feature has been published by Nicolai Parlog in the Inside Java Newscast #20.
3. Previews and Incubators
JEP 417: Vector API Third Incubator
Introduces a platform-agnostic, reliable way of clearly and concisely expressing a wide range of vector computations for supported CPU architectures.
JEP 419: Foreign Function and Memory API Second Incubator
Greatly simplifies the tools and knowledge required to create Java programs that utilize native. This will allow Java developers access to specialized non-Java libraries.
JEP 420: Pattern Matching for switch
Second Preview
Improves Java development productivity by expanding the expressiveness and applicability of switch expressions and statements. Allowing pattern matching in switch will make expressing complex data-oriented queries more concise and safer.
4. Deprecations
JEP 421: Deprecate Finalization
for Removal
Prepares developers for the eventual future removal of the outdated `Finalization feature by providing simple tooling to help detect reliance on the deprecated functionality.
A discussion with Brent Christian regarding the effort to gradually deprecate the finalization feature from the platform, as well as the alternatives to properly deal with resources, is available in the Inside Java podcast #21.
Tooling Support
Timely support for new features by tools and libraries helps drive developer productivity. With Java 18, we continue to welcome the efforts of leading IDE vendors whose most timely updates offer developers support for current Java versions. Developers can expect to take advantage of Java 18 support today with the following IDEs:
Resources
Java continues to be the #1 programming language for today’s technology trends. As the on-time delivery of improvements with Java 18 demonstrates, through continued thoughtful planning and ecosystem involvement, the Java platform is well-positioned for modern development and growth in the cloud.
Continue staying current with news and updates by:
- Visiting Dev.Java; Oracle’s dedicated portal to advance your Java knowledge and community participation.
- Visiting Inside.Java; news and views by the Java Team at Oracle.
- Listening to the Inside.Java podcasts; an audio show for Java Developers brought to you directly from the people that make Java at Oracle. Conversations will discuss the language, the JVM, OpenJDK, platform security, innovation projects like Loom and Panama, and everything in between.
- Watching Inside.Java Newscasts; a video show extending the Inside.Java podcast into a video format.
- Watching Java on YouTube; Oracle’s collection of relevant Java videos to help grow your Java expertise.
- Joining the OpenJDK mailing lists; the place to learn about the progress of your favorite OpenJDK projects.
- Following OpenJDK and Java on Twitter; social streams offering updates and news on the continual evolution of Java.
- Reading Java Magazine; Oracle’s digital Java publication offering technical articles by developers for developers.
- Learn how to programmatically download the latest version of the JDK.