Java 21 and Java 25 LTS, feature by feature. The catch-up read for engineers who shipped Java 11 and now need to write Java like it's 2026.
You wrote Java for a decade. Then the feature pace picked up. Records and sealed types in Java 17. Virtual threads and pattern matching for switch in Java 21. Java 25 is LTS. The standard library quietly added structured concurrency, the Foreign Function and Memory API, JFR streaming, stream gatherers, scoped values. Half the release notes were preview features that became standard three releases later. The team is on Java 21 in production and writing it like it's Java 11.
This book closes that gap. A feature tour of Java 21 LTS and Java 25 LTS, 22 chapters, one runnable Maven module per chapter. JDK-only by default. No framework noise.
What's inside:
- Language features: Records, sealed types, pattern matching for instanceof and switch, record patterns with guards, switch expressions, text blocks, var, unnamed variables, instance main methods.
- Concurrency: Virtual threads with the pinning gotcha and the synchronized warning, structured concurrency with StructuredTaskScope, scoped values, stable values.
- Standard library: java.net.http.HttpClient (sync, async, virtual-thread-friendly), sequenced collections, stream gatherers and custom intermediate operations, the parts of java.util most teams still under-use.
- Platform features: The Foreign Function and Memory API with a libcurl bridge, the Vector API, the Class-File API, modern GC choices (G1, ZGC, Generational ZGC, Shenandoah), JFR for production profiling, CDS, AppCDS, AOT (Project Leyden preview), jlink, jpackage.
Opinionated, not a feature catalog. Each chapter takes a position on whether the feature earns keystrokes. Records yes. Virtual threads for I/O-bound work with caveats. Pattern matching for the cases that used to be ten lines of instanceof. The places where the new feature is the right answer, and the places where the older form still wins.
Companion code: One runnable Maven module per chapter. Clone the repo and jump to the chapter you're reading.
Hard prerequisite: Working Java up to at least Java 11. This is not a Java tutorial. Readers landing from Java 17 already know half the material. Readers from Java 11 get the full upgrade story.
For: Working backend engineers writing Java in production.