Java 25, officially released on September 16, 2025, marks the latest long-term support (LTS) release following Java 21. This version builds on recent Java advancements, focusing on language expressiveness, concurrency improvements, performance optimizations, and monitoring enhancements.
It incorporates 18 JDK Enhancement Proposals (JEPs), along with various non-JEP updates, removals, and deprecations. Below, I’ll break down the key changes, grouped by categories where applicable, based on official documentation.
Language Innovations
Java 25 enhances the language to make it more concise, beginner-friendly, and flexible:
• Primitive Types in Patterns, instanceof, and switch (JEP 507, Third Preview): Extends pattern matching to support primitive types in patterns, instanceof, and switch statements, allowing seamless handling of primitives like integers or floats in these constructs.
• Module Import Declarations (JEP 511): Introduces a way to import all exported packages from a module with a single declaration, simplifying the use of modular libraries without requiring the importing code to be modular.
• Compact Source Files and Instance Main Methods (JEP 512): Allows streamlined single-class programs without traditional boilerplate, making it easier for beginners to start coding while enabling easy expansion to more complex features.
• Flexible Constructor Bodies (JEP 513): Permits statements before explicit constructor calls (e.g., super(...)), enabling field initialization and computations prior to superclass invocation for safer and more natural code.
Library Improvements
Updates to core libraries emphasize concurrency, data handling, and security:
• Structured Concurrency (JEP 505, Fifth Preview): Provides an API to treat related concurrent tasks as a single unit, improving error handling, cancellation, and observability in multithreaded code.
• Scoped Values (JEP 506): Introduces immutable data sharing within threads and child threads, offering a more efficient alternative to thread-local variables, especially with virtual threads.
• Stable Values (JEP 502, Preview): Adds an API for objects with immutable data treated as constants by the JVM, enabling optimizations similar to final fields but with flexible initialization.
• Vector API (JEP 508, Tenth Incubator): Enhances vector computations for better performance on supported hardware, compiling to optimal instructions over scalar equivalents.
• PEM Encodings of Cryptographic Objects (JEP 470, Preview): Adds an API for encoding/decoding keys, certificates, and revocation lists in PEM format.
• Key Derivation Function API (JEP 510): Introduces APIs for deriving keys from secrets using cryptographic algorithms like HKDF.
Other library enhancements include:
• New methods in CharSequence and CharBuffer for bulk character reading.
• HttpClient updates to limit response body sizes and identify connections.
• ZIP file system support for read-only or read-write modes.
• ForkJoinPool now implements ScheduledExecutorService with timeout support; CompletableFuture uses the common pool for async operations.
• Inflater and Deflater implement AutoCloseable.
• Security updates: New SHAKE algorithms in MessageDigest, HKDF support in SunPKCS11, TLS constraints, and XML Security upgraded to 3.0.5 with SHA-3 ECDSA.
Performance and Runtime Advancements
Focus on faster startups, better memory use, and garbage collection:
• Compact Object Headers (JEP 519): Promotes this from experimental to product feature, reducing object memory footprint.
• Ahead-of-Time Command-Line Ergonomics (JEP 514): Simplifies commands for creating AOT caches to speed up application startup.
• Ahead-of-Time Method Profiling (JEP 515): Uses profiles from prior runs for immediate JIT compilation at startup.
• Generational Shenandoah (JEP 521): Enhances the Shenandoah GC with generational collection for better throughput and latency.
Additional improvements:
• G1 GC reduces remembered set overhead by grouping regions.
• ZGC enhancements for fragmentation and accurate RSS reporting.
• Montgomery multiply intrinsic for faster crypto on x86_64 with AVX2.
• ML-DSA and ML-KEM performance boosts (1.5-2.7x on certain architectures).
Monitoring and Tools
JDK Flight Recorder (JFR) sees significant updates:
• JFR CPU-Time Profiling (JEP 509, Experimental): Improves CPU-time accuracy on Linux.
• JFR Cooperative Sampling (JEP 518): Enhances stack sampling stability by using safepoints with reduced bias.
• JFR Method Timing & Tracing (JEP 520): Adds bytecode instrumentation for method timing and tracing.
Other tool updates:
• Thread dumps include lock info and JSON schema links.
• jar --validate checks for duplicates and invalid entries.
• javac improvements: Null checks in constructors, rejection of lambda types as classes, and better linting.
• javadoc adds syntax highlighting, whitespace normalization, and keyboard navigation.
• JFR events throttled for sockets/files/exceptions; new @Contextual annotation.
Removed Features and Options
• Remove the 32-bit x86 Port (JEP 503): Drops support for 32-bit x86 architectures to streamline development.
• Experimental Graal JIT compiler removed.
• Old JMX properties, PerfData sampling, and certain performance counters eliminated.
• Expired root certificates (e.g., Baltimore CyberTrust, Camerfirma) removed from cacerts.
• SunPKCS11 PBE implementations and no-argument BasicSliderUI constructor gone.
• Socket constructors now reject stream=false.
Deprecated Features and Options
• System properties like java.locale.useOldISOCodes and -Djdk.lang.Process.launchMechanism=VFORK on Linux.
• JMX XML interchange and certain permission classes (e.g., UnresolvedPermission) marked for removal.
• UseCompressedClassPointers option.
What to Expect
As an LTS release, Java 25 will receive extended support from vendors like Oracle, typically including security updates for several years (e.g., until at least 2030 for Oracle’s offerings). Developers migrating from Java 21 can expect smoother concurrency with virtual threads, better AOT compilation for faster startups, and enhanced security. However, check compatibility, especially with removed 32-bit support or deprecated APIs. Future non-LTS releases (e.g., Java 26 in March 2026) will build on these, potentially previewing more pattern matching or concurrency features. For full details, refer to the official JDK 25 documentation.