ProLesson 13.6Advanced4 min readUpdated 30 October 2026
Java 22 to 25: compact source files, scoped values and more
Unnamed variables, the Foreign Function and Memory API, stream gatherers, then Java 25 LTS with compact source files, module imports, flexible constructors and scoped values.
Java 25 (September 2025) is the newest LTS. Several long-running previews became final on the way. This lesson covers the final features from Java 22 to 25, the ones you can use in production.
01What became final, release by release
| Release | Final features (selection) |
|---|---|
| Java 22 (Mar 2024) | Unnamed variables and patterns (_) · Foreign Function & Memory API · Launch multi-file source-code programs · Region pinning for G1 |
| Java 23 (Sep 2024) | Markdown documentation comments (///) · ZGC generational mode by default |
| Java 24 (Mar 2025) | Stream gatherers · Class-File API · Synchronize virtual threads without pinning · Ahead-of-time class loading and linking · Quantum-resistant ML-KEM and ML-DSA · Security Manager permanently disabled |
| Java 25 (Sep 2025, LTS) | Compact source files and instance main methods · Module import declarations · Flexible constructor bodies · Scoped values · Compact object headers · Generational Shenandoah · Key Derivation Function API · AOT method profiling and command-line ergonomics |
Loading the rest of the lesson…