image-blog-java-15
June 24, 2020

Guide to Java 15: Release Dates, EOL, JEPs and More

Java Updates
Open Source

Java 15 marks an important feature release in the build-up to Java 17, and offers some exciting new features, preview features, and incubator features for the JDK.

In this article, we look at the details surrounding Java 15, including release dates, features, and adoption projections.

Back to top

What Is Java 15?

Java 15, or JDK 15, is the reference implementation of version 15 of the Java SE Platform.

Java 15 lists 15 major improvements, including the Sealed Classes preview feature, Hidden Classes, Text Blocks, Records preview feature, and the second incubator period for the Foreign-Memory Access API. The promotion of the ZGC and Shenandoah GC from experimental to production are also major improvements for productions systems requiring low-latency garbage collectors.

Java 15 Release Date

Java 15 is scheduled for public release on September 15th, 2020. Important dates for the release schedule are included below.

Java 15 Release Dates
DateRelease Phase
2020/06/11Rampdown Phase One (fork from main line)
2020/07/16Rampdown Phase Two
2020/08/06Initial Release Candidate
2020/08/20Final Release Candidate
2020/09/15General Availability

 

Java 15 EOL

OpenJDK 15 is a non-long-term support version and will be supported for a total of six months, with LTS scheduled to end in March of 2021.

Those plans may change if the community decides to change course on their current default support period. And, of course, companies like Azul will presumably continue to provide paid LTS services for non LTS OpenJDK versions.

Image Hub New Features Java Body Timeline OpenJDK
Back to top

Java 15 Features

Java 15 features include notable additions and subtractions to Java, including the continued enablement of pattern matching features as outlined in Project Amber. Notable deprecations include the removal of the Nashorn JavaScript Engine.

Lastly, JEP 358: Helpful NullPointerException will now be set by default (instead of requiring you to enable it manually).

Java 15 Features
JEP NumberFeature
339Edwards-Curve Digital Signature Algorithm (EdDSA)
360Sealed Classes (Preview)
371Hidden Classes
372Remove the Nashorn JavaScript Engine
373Reimplement the Legacy DatagramSocket API
374Disable and Deprecate Biased Locking
375Pattern Matching for instanceof (Second Preview)
377ZGC: A Scalable Low-Latency Garbage Collector
378Text Blocks
379Shenandoah: A Low-Pause-Time Garbage Collector
381Remove the Solaris and SPARC Ports
383Foreign-Memory Access API (Second Incubator)
384Records (Second Preview)
385Deprecate RMI Activation for Removal

Arguably the biggest language feature for JDK 15 is the preview addition of sealed classes, which help developers to precisely outline available subtypes while laying the groundwork for further pattern matching improvements.

JEP 360: Sealed Classes (Preview)

Sealed classes, as noted above, offer a more precise way to declare available subclasses within a superclass. Essentially sealed classes help make superclasses accessible while limiting unintended extensibility.

A sealed class or interface can be extended or implemented only by those classes and interfaces permitted to do so.

As an example, imagine a simple calculator, allowing you to do basic mathematical expression of adding, subtracting, dividing and multiplying. Using a sealed class, a developer could declare a BinaryExpression interface, and explicitly permit only those four implementations.

public sealed interface BinaryExpression
    permits Addition, Subtraction, Division, Multiplication {
    double perform(double x, double y);
}
public final class Addition implements BinaryExpression {
    @Override
    double perform(double x, double y) {
        return x + y;
    }
}
/* etc */

Knowing exactly which subtypes exists can simplify code, in that you know you can never get an unknown type – no need for a catch-all else block, or the default section in a switch; the latter will be important for Pattern Matching in the future, where for sealed classes the javac compiler can detect if the switch is exhaustive. Likewise, for serialization of data to formats with schemas, such as xml, you know all possible subtypes are supported in your format.

JEP 371: Hidden Classes

Hidden classes are another important, albeit hidden, addition for Java 15. While hidden classes aren’t something the average Java developer will interact with directly, Java framework developers, or anybody working with proxies,or other dynamically created at runtime will likely be using hidden classes. The key function of hidden classes is that they create classes that “cannot be used directly by the bytecode of other classes.”

The concept of hidden classes already exists in the form of JVM anonymous classes (not to be confused with anonymous inner classes in the source code). This JEP introduces a supported API for defining such classes; something that previously could only be done via Unsafe.

JEP 378: Text Blocks

After a second preview round in Java 14 that added two new escape sequences, Text Blocks are now scheduled for addition as a full feature in Java 15. In case you haven’t been following the raw string literal saga, text blocks were first conceptualized as raw string literals under JEP 326 for Java 12. Raw string literals were subsequently withdrawn, appearing as a more realized feature under JEP 355: Text Blocks (Preview). Now as a fully realized feature, text blocks will introduce a way for developers to predictably format multi-line string literals – with considerations for avoiding most escape sequences. If you want to learn more about text blocks through their various iterations, our blog on text blocks is worth a read.

JEP 384: Records (Second Preview)

JEP 384 marks the second preview period for the Java records feature. First introduced under JEP 359, records propose an easier, clearer way to write data aggregate classes. One of the big benefits of the records language feature, as we explore in our article on records in Java, is that it helps to eliminate the need for assessing the meaning and intent of boilerplate code.

The biggest change in the second preview compared to the first, is the disallowance of this in the constructor, enforcing the "auto initialized" idiom of the record’s compact constructor. JEP 384 also serves more as an extended review period for Java users.

JEP 375: Pattern Matching for instanceof (Second Preview)

JEP 375 marks the second preview phase for : Pattern Matching for instanceof. It first appeared as JEP 305, and represents part of a larger effort for pattern matching under Project Amber. Pattern matching for instanceof allows for Pattern matching for instanceof allows for combining an instanceof check with a variable declaration, containing the checked object casted to the checked type, should the instanceof check succeed.

The second preview clarifies and corrects some issues with the specification, but otherwise is equivalent to the spec of the first preview. Additional planned pattern matching features include those for switch expressions and statements.

JEP 372: Remove the Nashorn JavaScript Engine

The Nashorn JavaScript Engine was added in JDK 8, as a potential replacement to the Rhino scripting engine, as part of a push to support more dynamic languages in the JVM. But with the introduction of GraalVM, the focus for multi-language support has moved there. Nashorn was first marked for removal in Java 11, but has been part of the JDK through JDK 14. This isn’t a particularly impactful change, but is important for the separation it signals.

Other Features in Java 15

While the Java 15 features we talked about above may be more important to the big Java picture, the rest of the features and deprecations slated for Java 15 are worth mentioning

  • JEP 339: Edwards-Curve Digital Signature Algorithm (EdDSA)
  • JEP 373: Reimplement the Legacy DatagramSocket API
  • JEP 374: Disable and Deprecate Biased Locking
  • JEP 377: ZGC: A Scalable Low-Latency Garbage Collector
  • JEP 379: Shenandoah: A Low-Pause-Time Garbage
  • JEP 381: Remove the Solaris and SPARC Ports
  • JEP 385: Deprecate RMI Activation for Removal

Of these remaining Java 15 features, the two most interesting are the ZGC and Shenandoah garbage collectors, which are interesting specifically because they went from experimental to fully-realized features so quickly. Sheandoah is even more interesting because it won’t be a part of the Oracle Java SE 15 distribution.

Back to top

Final Thoughts

Java 15 is a fairly big release in terms of impactful features. With many of the features backed by big names in Java, we expect many of these preview and incubatory features to become solidified full features before Java 17.

But, in terms of adoption, we don’t foresee Java 15 becoming a runaway success. For most teams, leveraging these features only to migrate six months later isn’t worth the time or money. The real question is how much these features will impact adoption of the next LTS version, Java 17.

Additional Resources

If you want to learn more about OpenJDK, Java, and the JEPs that gradually shape the language, we have a number of great resources worth reading and watching.

Take Full Advantage of the Latest Java Versions With JRebel

We work to ensure JRebel are always compatible with the latest Java release. Want to see how JRebel can help you save time during development by skipping redeploys? You can try it free for 10 days via the link below.

Try JRebel Free for 10 Days

Back to top