JDK 15 is now generally available!


This Wednesday JDK 15 reached general availability. This release comes with the Edwards-Curve Digital Signature Algorithm, preview version of sealed classes, hidden classes, and more.

Here are some of the highlights in JDK 15:

Edwards-Curve Digital Signature Algorithm (EdDSA)


Starting this release developers can implement cryptographic signatures using EdDSA, a variant of Schnorr's signature system with (possibly twisted) Edwards curves.


According to its RFC document, EdDSA comes with several advantages including:

  • High performance on a variety of platforms
  • Does not require the use of a unique random number for each signature
  • More resilient to side-channel attacks
  • Uses small public keys (32 or 57 bytes) and signatures (64 or 114 bytes) for Ed25519 and Ed448, respectively
  • Provides collision resilience, meaning that hash-function collisions do not break this system (only holds for PureEdDSA)


Sealed classes and interfaces


This release comes with the preview version of sealed classes and interfaces. You can define a class or interface sealed by if you want to restrict which other classes or interfaces may extend or implement them.


You just need to apply the sealed modifier to the class or interface declaration. Then, after any extends and implements clauses, the permits clause will specify the classes that are permitted to extend the sealed class. 


Hidden classes


This release introduces hidden classes, which are classes that cannot be used directly by the bytecode of other classes. These classes are intended for use by frameworks that generate classes at run time and use them indirectly, via reflection. 


Removed the Nashorn JavaScript Engine


After deprecating them in Java 11, the team has now removed the Nashorn JavaScript script engine and APIs, and the jjs tool in this release. 


Pattern Matching for instanceof (Second Preview)


JDK 15 allows pattern matching for the instanceof operator. It was proposed by JEP 305 in 2017 and targeted to JDK 14 in late 2019 as a preview language feature. This is the second preview of the feature in the hopes of gathering additional feedback.


In a Hacker News thread, many developers showed their excitement about this release. A developer shared, "I've got a few very specific use cases where I'm going to be so glad to have sealed classes[0]. Oddly not mentioned in the release notes, but they're like a final class, except you can say "These classes are allowed to be subclasses of this class"."


Another developer added, "I haven't been this excited about Java since JDK 1.2. 

Especially Project Loom. Virtual threads will be a game changer. A return to original Java's rallying cry of programmer productivity. 

There's always been steady progress, sure. But it seems like Oracle is much less risk adverse. Or maybe the governance changed. Or maybe Sun, IBM, other had been holding back a lot of progress. I'd love to know the backstories. To better inform future efforts. Regardless, Java today is amazing and rapidly getting better."


Read the official JDK 15 release notes for more details.


Comments