JDK 25
JDK 25 reached General Availability on 16 September 2025.
Production-ready binaries under the GPL are available from Oracle
JDK 25 is a long-term support (LTS) release from most vendors. For a complete list of the JEPs integrated since the previous LTS release, JDK 21, please see here.
Binaries from openJDK are available here:
https://jdk.java.net/25/
https://openjdk.org/projects/jdk/25/
Release notes from Oracle
https://www.oracle.com/java/technologies/javase/25-relnote-issues.html
🚀 What JDK 25 brings
Major new additions / enhancements:
- 
Compact Object Headers (JEP 519): reduces object header size for many objects on 64-bit platforms → lower memory and better heap density. Java Code Geeks+1 
- 
Scoped Values (JEP 506): a safer/more efficient alternative to ThreadLocalfor context propagation, especially with virtual threads. Java Tech Online+1
- 
Flexible Constructor Bodies (JEP 513): allows code before super()/this()in constructors. HappyCoders.eu
- 
Compact Source Files & Instance Main Methods (JEP 512): lets you write simpler top-level code without class boilerplate (good for learning, quick scripts). Java Tech Online 
- 
Primitive Types in Patterns (JEP 507, preview): pattern matching now supports primitives (int, double, etc.). Baeldung on Kotlin+1 
- 
Performance & runtime enhancements: - 
Generational Shenandoah GC (JEP 521) becomes supported. Java Code Geeks 
- 
JDK Flight Recorder (JFR) improvements: better CPU-time profiling, method timing & tracing. Java Tech Online+1 
 
- 
- 
Security / cryptography: Key Derivation Function API (JEP 510) finalised to support modern cryptograpic workflows. JDK Builds 
- 
Module import declarations (JEP 511): easier modular code reuse/imports. Java Tech Online 
- 
JDK 25 is also an LTS release. OpenJDK+1 
What this means for you:
- 
Significant runtime and memory improvements: if you manage large scale Java services you’ll likely benefit from Compact Object Headers, improved GC, and profiling tools. 
- 
More expressive language features continue to expand. 
- 
Better support for modern concurrency/context propagation (via Scoped Values) which ties into virtual threads. 
- 
If you build frameworks or libraries, features like Module Import Declarations may reduce boilerplate for users. 
- 
The migration path from 21 → 25 is relevant because many new features are production-ready (no longer preview) so you may want to plan early. 
📋 Side-by-side comparison
| Category | JDK 21 | JDK 25 | 
|---|---|---|
| Status | LTS (Sep 2023) | LTS (Sep 2025) | 
| Major concurrency addition | Virtual threads finalised HowToDoInJava+1 | Scoped Values finalised; further concurrency ecosystem improvements Java Code Geeks+1 | 
| Language expressiveness | Record patterns, switch pattern matching, sequenced collections Baeldung on Kotlin | Adds flexible constructors, primitive types in patterns (preview), compact source files Java Tech Online | 
| Performance / runtime | Improved JVM generally, new APIs | Compact object headers, generational Shenandoah GC, better profiling tools Java Code Geeks | 
| Cryptography/security | KEM API introduced InfoWorld | Key Derivation Function API final, better security readiness JDK Builds | 
| Library & tooling | Good improvements | Module import declarations, further enhancements in tooling and observability Java Tech Online | 
| Preview features status | Many preview (string templates, unnamed classes) Baeldung on Kotlin | Some features still preview/incubator (primitive types in patterns) Java Tech Online | 
| Migration / production readiness | Very production-ready at release | Already production-ready for many features, but some still in preview – evaluate accordingly | 
 
No comments:
Post a Comment