Java 21 Released: Virtual Threads and an LTS Milestone
Java 21, a long-term-support release, delivered production-ready virtual threads, finalized pattern matching for switch and record patterns, and added generational ZGC and sequenced collections.
Historical Archive. This article documents an event from 2023 and is preserved with its original date for reference. It is not current news, and details may have changed since publication.
What happened
Java 21 (JDK 21) was released on September 19, 2023, according to Oracle's official announcement on inside.java by Sharat Chander. It was the 12th feature release on the six-month cadence and the first long-term-support release since Java 17 in 2021, with Oracle offering support for at least eight years. The release delivered 15 JEPs covering six preview features and one incubator.
Virtual threads
The marquee feature was virtual threads, finalised through JEP 444 after two preview rounds in Projects Loom. Virtual threads are lightweight threads that let server applications written in the simple thread-per-request style scale with near-optimal hardware utilisation, dramatically reducing the effort of writing, maintaining and observing high-throughput concurrent applications while working with the existing java.lang.Thread API.
Pattern matching and records
Java 21 finalised pattern matching for switch via JEP 441, allowing patterns in case labels so complex data-oriented queries can be expressed concisely and safely, and finalised record patterns via JEP 440 to de-structure record instances, including nested patterns. It also previewed string templates, unnamed patterns and variables, and unnamed classes with instance main methods to offer a smoother on-ramp for new Java learners.
Performance and libraries
The release added generational ZGC via JEP 439, extending the Z Garbage Collector to maintain separate generations for young and old objects, lowering allocation-stall risk and CPU overhead while keeping pause times under a millisecond. It also introduced sequenced collections via JEP 431 with uniform APIs for first and last elements, a Key Encapsulation Mechanism API, and previews of scoped values and structured concurrency.
Why it mattered
Java 21 was a landmark LTS release. Virtual threads reshaped how developers write scalable concurrent code on the JVM, while finalised pattern matching and record patterns modernised the language's data handling. As a long-supported foundation, it became a natural upgrade target for teams on Java 17 and earlier.
Related on Skillo
See also: Java 17 and sealed classes, Java 22's Foreign Function and Memory API.
Sources
Published date reflects the original event date (2023-09-19). This article is original Skillo editorial written from the sources above; facts were verified in September 2026.
Written by
Skillo Staff
0 Comments
Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.