JDK 25 Changelog: All New Features
A complete list of features and JEPs in JDK 25 (LTS, September 2025), including Module Import Declarations, Flexible Constructor Bodies, Scoped Values, and generational Shenandoah.
JDK 25 Changelog
JDK 25 was released on 16 September 2025 and is the new LTS release, replacing JDK 21 as the long-term supported version. It brings several long-awaited features to a final state: Module Import Declarations, Flexible Constructor Bodies, Scoped Values, and Compact Source Files.
JEP Summary
| JEP Number | Feature |
|---|---|
| 470 | PEM Encodings of Cryptographic Objects (Preview) |
| 502 | Stable Values (Preview) |
| 503 | Remove the 32-bit x86 Port |
| 505 | Structured Concurrency (Fifth Preview) |
| 506 | Scoped Values |
| 507 | Primitive Types in Patterns, instanceof, and switch (Third Preview) |
| 508 | Vector API (Tenth Incubator) |
| 509 | JFR CPU-Time Profiling (Experimental) |
| 510 | Key Derivation Function API |
| 511 | Module Import Declarations |
| 512 | Compact Source Files and Instance Main Methods |
| 513 | Flexible Constructor Bodies |
| 514 | Ahead-of-Time Command-Line Ergonomics |
| 515 | Ahead-of-Time Method Profiling |
| 518 | JFR Cooperative Sampling |
| 519 | Compact Object Headers |
| 520 | JFR Method Timing & Tracing |
| 521 | Generational Shenandoah |
Key Features
Module Import Declarations (JEP 511) — Final
It exits the preview phase for good: you can import an entire Java module (or the modules of a package) with a single statement:
import module java.util;
// or
import module java.base;
var list = new ArrayList<Integer>(); // no explicit imports needed
Flexible Constructor Bodies (JEP 513) — Final
Constructors can run statements before the super(...) call, simplifying validation and initialization logic without auxiliary static constructors:
class Time {
Time(int hours) { this.hours = hours; }
final int hours;
}
class TwelveHourTime extends Time {
TwelveHourTime(int h) {
h %= 12; // before super(...)
super(h == 0 ? 12 : h);
}
}
Scoped Values (JEP 506) — Final
Scoped Values (a typed, faster alternative to ThreadLocal) become stable for passing immutable data down the call chain without explicit parameters:
static final ScopedValue<String> USER = ScopedValue.newInstance();
// Where needed
USER.where("friendship", () -> {
// The scoped value is available here
});
Compact Source Files and Instance Main Methods (JEP 512) — Final
The single source-file / instance main method model becomes definitive: simple programs no longer require a class wrapper or public static void main:
// hello.java
void main(String[] args) {
System.out.println("Hello, world!");
}
java hello.java
Generational Shenandoah (JEP 521)
The Shenandoah collector — experimental in JDK 24 — is now stabilized in generational mode, with even lower pause times and better throughput for large heaps:
java -XX:+UseShenandoahGC -XX:+ShenandoahGenerational -jar app.jar
JFR CPU-Time Profiling & Method Timing (JEP 509, 518, 520)
A series of Java Flight Recorder improvements: CPU-time profiling, cooperative sampling, and method timing/tracing for much deeper performance analysis.
AoT Command-Line Ergonomics & Method Profiling (JEP 514, 515)
Improves command-line ergonomics for ahead-of-time compilation and method profiling, simplifying work with applications that require fast startup.
Other Changes
- Remove the 32-bit x86 Port (503): The 32-bit x86 port is removed.
- Key Derivation Function API (510): The KDF API becomes standard.
- Compact Object Headers (519): Project Lilliput.
- Stable Values (502): Preview.
- PEM Encodings of Cryptographic Objects (470): Preview.
- Structured Concurrency (505): Fifth preview.
- Primitive Types in Patterns (507): Third preview.
- Vector API (508): Tenth incubator.
Conclusion
JDK 25 is the new LTS and marks an important milestone: Module Import Declarations, Flexible Constructor Bodies, and Scoped Values reach their final state, while JFR and garbage collection are significantly strengthened. For anyone planning a long-lived upgrade destined to stay in production for years, JDK 25 is the natural choice after JDK 21.