Fundamentals 8 min read

What’s New in Java 21? A Complete Guide to Features and Version History

This article outlines Java 21’s release as the next LTS, highlights its new standard, preview, and incubating features—including virtual threads, record patterns, and the Vector API—and provides a concise timeline of major enhancements from Java 8 through Java 20.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
What’s New in Java 21? A Complete Guide to Features and Version History

1. Introduction

Java 21 will be released on September 19, 2023, as the next LTS after Java 17. Virtual threads become a standard feature and can be enabled in Spring Boot 3.2 with

spring.threads.virtual.enabled=true

. Java 21 is expected to become as popular as Java 8.

2. Java 21 Feature Updates

2.1 Standard Features

Virtual Threads

Sequenced Collections

Record Patterns

Pattern Matching for switch

Generational ZGC

Deprecate the Windows 32‑bit x86 Port for Removal

Prepare to Disallow the Dynamic Loading of Agents

Key Encapsulation Mechanism API

2.2 Preview Features

Unnamed Classes and Instance Main Methods

String Templates

Unnamed Patterns and Variables

Foreign Function & Memory API

Structured Concurrency

Scoped Values

2.3 Incubator Feature

Vector API

3. Java 8‑20 Release History

Java 8 (March 2014) – LTS, maintenance extended to December 2030.

Lambda expressions, method references, functional interfaces

New date/time API

Metaspace replaces PermGen

Parallel array support

Nashorn JavaScript engine

Java 9 (September 2017)

Module system

Improved Javadoc

HTTP/2 client

Collection factory methods

Reactive Streams API

Private interface methods

JShell REPL

Java 10 (March 2018)

Local‑variable type inference (var)

Improved G1 GC

Unicode 10 support

Application Class‑Data Sharing

Java 11 (September 2018) – LTS, maintenance ends September 2026

Standardized HTTP client

Improved ZGC

Epsilon GC

Serialization filters

Unicode 10.0.0 support

Java 12 (March 2019)

Shenandoah GC

New switch expression syntax

Improved G1 GC

Microbenchmark Suite

Java 13 (September 2019)

Text Blocks

ZGC and Shenandoah enhancements

Improved switch expression

Dynamic CDS Archives

Unicode 12.0.0 support

Java 14 (March 2020)

Records

Pattern Matching for instanceof

NUMA‑Aware Memory Allocation

Unicode 12.1 support

Java 15 (September 2020)

Enhanced Text Blocks

Sealed Classes

Hidden Classes

Unicode 13.0.0 support

Java 16 (March 2021)

Records enhancements

Pattern Matching for instanceof and switch enhancements

Vector API

JEP 390 removal of warning messages

Java 17 (September 2021) – LTS, maintenance ends September 2029

Native support for nested access control

Sealed and Hidden Class enhancements

Nested development environment API

Foreign Function Interface (FFI)

Secure random number generator

Java 18 (March 2022)

Default UTF‑8 charset

Simple web server (jwebserver)

Javadoc code snippets

Method‑handle based reflection

Internet address resolution SPI

Vector API (third incubation)

Foreign Function & Memory API (second incubation)

Java 19 (September 2022)

JDK ported to Linux/RISC‑V

Record Patterns preview

Foreign Function & Memory API preview

Virtual Threads preview

Vector API fourth incubation

Pattern Matching for switch third preview

Structured Concurrency incubation

Java 20 (March 2023)

Scoped Values first incubation

Record Patterns second preview

Pattern Matching for switch fourth preview

Foreign Function & Memory API second preview

Virtual Threads second preview

Structured Concurrency second incubation

Vector API fifth incubation

programming languagejdk-featuresltsspring-bootjava21virtual-threads
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.