ceritasaham 

JDK 25 Changelog: All New Features

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.

20 September 2026#java#jdk#changelog#jdk-25

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 NumberFeature
470PEM Encodings of Cryptographic Objects (Preview)
502Stable Values (Preview)
503Remove the 32-bit x86 Port
505Structured Concurrency (Fifth Preview)
506Scoped Values
507Primitive Types in Patterns, instanceof, and switch (Third Preview)
508Vector API (Tenth Incubator)
509JFR CPU-Time Profiling (Experimental)
510Key Derivation Function API
511Module Import Declarations
512Compact Source Files and Instance Main Methods
513Flexible Constructor Bodies
514Ahead-of-Time Command-Line Ergonomics
515Ahead-of-Time Method Profiling
518JFR Cooperative Sampling
519Compact Object Headers
520JFR Method Timing & Tracing
521Generational 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.

mode [MARKET REGULER]build #ba129dblast update: Sep 22, 2026, 07:43:27 PM UTC▚▚ DYOR! Disclaimer ON! ▚▚