Java

What's in JDK 17, the LTS That Stuck

Even though we are a few months ahead of schedule, Java 17 is now taking shape and worth talking about. There are four really good features planned for the upgrade to Java.

What's in JDK 17, the LTS That Stuck

JDK 17 (September 2021) is the long-term-support release that ended up everywhere — the version the Java ecosystem settled on after 8 and 11. What it shipped explains why.

Sealed classes

sealed lets a type declare exactly which classes may extend it — exhaustiveness the compiler can check. Paired with records and pattern matching, Java got a real algebraic-data-type story: model a fixed set of shapes and the compiler enforces every case.

Pattern matching for instanceof

if (obj instanceof String s) { ... } — cast and bind in one step. Small syntax, huge habit change; it removed a generation of boilerplate and set up the switch pattern matching that came later.

Strong encapsulation of JDK internals

The controversial one: JDK internals (sun.misc.Unsafe and friends) stopped being reachable by default. The ecosystem had leaned on internals for years; 17 forced the cleanup. Libraries that depended on them either migrated to supported APIs or died — which is what the change was for.

The rest

Security updates (SHA-3, EdDSA), a macOS/AArch64 port, removal of the old RMI activation and Nashorn JavaScript engine. The LTS mattered less for any single feature than for being the stable point everything else built on.

$ tail -f /forums

Discussion

Comments live on the community forums — sign in there to reply.