September 29th, 2025
0 reactions

Microsoft’s OpenJDK builds now ready for Java 25

Bruno Borges
Principal PM Manager

We’re excited to announce that the Microsoft Build of OpenJDK binaries are now available for Java 25. As always, our builds aim to provide a high-quality, production-ready build of OpenJDK, with binaries tested across platforms (Windows, Linux, macOS) and backed by our support and release pipelines. With this release, we invite developers, teams, and organizations to start migrating to Java 25, and in doing so, to take advantage of the many enhancements that have accumulated since Microsoft Build of OpenJDK 21 (our previous LTS release).

Microsoft Build of OpenJDK 25 is fully supported for deployment on Azure Container Apps, Azure App Service, Azure Functions, and Azure Kubernetes Service, with up to date container images, so teams can modernize confidently for cloud-native hosting on Azure. Services with language runtimes managed by Microsoft will roll out JDK 25 binaries sometime in late October.

In this post, we will walk through the highlights of what’s new in Java 25, with short examples to quickly understand the changes. For a canonical list of JEPs (JDK Enhancement Proposals) since OpenJDK 21, see this official OpenJDK page.

What’s New in Java 25

These are the enhancements in Java 25 that are production-ready. Below are the (non exhaustive) highlights along with usage examples.

1. Compact Source Files & Instance Main Methods (JEP 512)

This feature makes Java lighter and more approachable for scripts, demos, small utilities, and even for education. You can now write a source file without a class declaration and use an instance main method instead of static. And you can simply run with “$ java Hello.java“.

Code sample

Plus, these files get automatic imports of all classes on the java.base module.

2. Flexible Constructor Bodies (JEP 513)

Previously, Java required that any constructor must start by calling super(…) or this(…). With JEP 513, you can now execute validation or setup logic before the invocation of the superclass constructor, making it easier to centralize argument checks or shared initialization. Notice that the validation happens before the super(…) call, making the code cleaner and avoids duplication of parameter-checking logic across different constructors.

Code sample

3. Scoped Values (JEP 506)

Scoped values are a lighter, more structured alternative to ThreadLocal. They integrate nicely with structured concurrency or virtual threads, enabling controlled context passing across call chains with minimal synchronization overhead. Here, each task runs inside a ScopedValue.where(…).run(…) context, and inside that you can call USER.get() safely without null-checks or synchronization.

Code sample

4. Key Derivation Function API (JEP 510)

Java 25 adds support for standard password-based key derivation algorithms (such as PBKDF2) in the JDK cryptography APIs, reducing reliance on third-party libraries. This brings popular key derivation into the JDK ecosystem, improving security and interoperability. Before Java 25, you needed third-party libraries (e.g., BouncyCastle) for PBKDF2. Now it’s built into the JDK, making secure password-based key derivation standard and portable.

Code sample

5. Module Import Declarations (JEP 511)

In modular applications, we’ve long had to write verbose module-info.java files to declare dependencies. With JEP 511, Java source files can declare module imports directly. This is especially helpful for small programs, scripts, or teaching.

code

Other Stable Enhancements

  • Compact Object Headers (JEP 519): reduces memory overhead per object on 64-bit systems. To enable it, the JVM must be started with -XX:+UseCompactObjectHeaders

  • Generational Shenandoah (JEP 521): adds generational collection to the Shenandoah GC for better throughput and pause times.

  • JFR Cooperative Sampling (JEP 518) and JFR Method Tracing (JEP 520): improve profiling detail and efficiency.

  • Ahead-of-Time Profiling APIs (JEPs 514–515): provide new ergonomics for profiling and simulation of AOT constraints.

  • Removal of 32-bit x86 port (JEP 503): With OpenJDK 25, only 64-bit platforms are now supported.

Together, these enhancements improve the runtime efficiency, observability, and maintainability of Java applications and the OpenJDK project itself. Compact object headers reduce memory footprint for large heaps, while generational Shenandoah boosts garbage collection performance in workloads with many short-lived objects. The new JFR features make profiling more accurate and less intrusive, and the AOT profiling ergonomics help developers prepare for static compilation scenarios. Finally, dropping the legacy 32-bit x86 port simplifies the platform and focuses optimization efforts on modern 64-bit systems.

Modernize to Java 21 and Make the Leap to Java 25

Most enterprise applications are still running on Java 8 or Java 11. While Java 25 brings exciting new features, the biggest step-change comes from modernizing to Java 21, the latest LTS release… until now! Moving from 8 → 21 unlocks virtual threads, pattern matching, better garbage collectors, and dozens of security and performance improvements that will make your applications leaner, faster, and easier to maintain.

To help teams make this transition, Microsoft provides the GitHub Copilot App Modernization for Java extension. It automates the hardest parts of upgrading:

  • Dependency & framework analysis — identifies what needs updating and why.

  • Code transformations — powered by OpenRewrite recipes, tailored to your project.

  • Security remediations — flags outdated dependencies and CVEs.

  • Cloud-readiness checks — containerization and configuration fixes built-in.

Solution

With this tool, you can confidently modernize from Java 8 to Java 21, and once on 21, adopting 25 becomes a smooth leap forward — letting you take advantage of the newest language features, runtime optimizations, and developer ergonomics.

In summary…

With the Microsoft Build of OpenJDK for Java 25 now available, developers can explore Modern Java. Between the language and API additions, and the runtime features pointing toward future directions, Java continues its steady evolution.

We encourage you to download, explore, test, and share feedback. If you run into anything or find something surprising, we would love to know.

Happy coding!

Author

Bruno Borges
Principal PM Manager

Bruno is Principal Program Manager for Microsoft's Java Engineering Group. Previously the Java lead for Azure Developer Relations. Conference speaker, open source contributor, Java Champion and influencer, Twitter junkie, beer sommelier.

0 comments