Java 21
Status | Long Term Support Release |
---|---|
Release Date | 2023-09-19 |
EOL Date | 2029-12 |
Latest Version | 21.0.8 |
Umbrella JSR | JSR 396 |
Class File Version | 65.0 |
Unicode Version | 15.0.0 |
API Changes | Compare to 20 - 19 - 18 - 17 - 16 - 15 - 14 - 13 - 12 - 11 - 10 - 9 - 8 - 7 - 6 - 5 - 1.4 - 1.3 - 1.2 - 1.1 - 1.0 |
Documentation | Release Notes, Language Spec, VM Spec, JavaDoc |
SCM | git |
Java 21 is a current long term support (LTS) release.
New Features
Here are all new features in Java 21 by category. There is also of list of all features of all Java releases.
JVM
- Generational ZGC (JEP 439)
- Deprecate the Windows 32-bit x86 Port for Removal (JEP 449)
- Prepare to Disallow the Dynamic Loading of Agents (JEP 451)
Language
- String Templates 1. Preview (JEP 430, Java Almanac)
- Record Patterns (JEP 440, Java Almanac)
- Pattern Matching for switch (JEP 441, Java Almanac)
- Unnamed Patterns and Variables 1. Preview (JEP 443)
- Unnamed Classes and Instance Main Methods 1. Preview (JEP 445, Java Almanac)
API
- Sequenced Collections (JEP 431)
- Foreign Function & Memory API 3. Preview (JEP 442)
- Virtual Threads (JEP 444, Java Almanac)
- Scoped Values 1. Preview (JEP 446)
- Vector API 6. Incubator (JEP 448)
- Key Encapsulation Mechanism API (JEP 452)
- Structured Concurrency 1. Preview (JEP 453)
Should I Upgrade?
With Java 21 you're running on a actively maintained long term support (LTS) version - which is good. The currently planned end-of-life date for this version within the OpenJDK project is 2029-12.
However, you might consider upgrading to a newer LTS version Java 25 to get advantage of the latest features and improvements.
Downloads
Vendor | Product | License | Platform Downloads |
---|---|---|---|
Adoptium | Eclipse Temurin | GPLv2+CE | |
Amazon | Corretto 21 | GPLv2+CE | |
Azul Systems | Zulu Builds of OpenJDK 21 | GPLv2+CE | |
Azul Systems | Azul Prime | Commercial |
|
BellSoft | Liberica | GPLv2+CE | |
IBM | Semeru Runtime Open Edition, Version 21 | GPLv2+CE | |
Microsoft | Microsoft Build of OpenJDK 21 | GPLv2+CE | |
Oracle | Oracle JDK 21 | Oracle No-Fee | |
Red Hat | Red Hat build of OpenJDK 21 | GPLv2+CE | |
SAP | SapMachine 21 | GPLv2+CE |
Sandbox
Instantly compile and run Java 21 snippets without a local Java installation.