Micronaut Framework 5.0 with Java 25 baseline
by Sergio Del Amo CaballeroStarting with Micronaut Framework 5.0, to be released in Q2 2026, the Java baseline will be Java 25.
Use modern Java features
By setting a Java 25 baseline, we can improve our internal code and public APIs by continuing to use features such as Virtual Threads, Structured Concurrency, Scoped Values, Pattern Matching for switch, Record Patterns, and String Templates.
For example, Micronaut Framework 5.0 provides an alternative implementation of context propagation that uses Scoped Values, in addition to the default implementation based on thread-local variables.
Cloud vendors ready for Java 25
Many Micronaut users deploy to the cloud, and cloud vendors are preparing for Java 25. For example, AWS Lambda runtimes, AWS Elastic Beanstalk, and Google Cloud Functions.
We are confident that Azure Functions and OCI (Oracle Cloud Infrastructure) Functions
will soon support Java 25.
Show modern code in our documentation
Micronaut Guides and Micronaut module documentation embed code samples from real applications.
By setting a Java 25 baseline, we can update those samples to use modern Java features, making the language more appealing and improving the developer experience.
Performance improvements
Java 25 brings performance improvements. By building and releasing artifacts with a baseline of Java 25, Micronaut users can benefit from these improvements when upgrading to the latest framework version.
Reduce CI build times
Micronaut Framework 4.0 continuous integration tests run against a matrix of Java versions: 17, 21, and 25.
Our Java 25 builds are already significantly faster. By dropping support for older Java versions in Micronaut Framework 5.0, we can build and test modules more quickly and deliver features faster to the Micronaut community.
A message to the Java community
The Java community should embrace Java 25. As framework developers, we should take a clear position. It is time to move forward. Your applications will run faster, and your development experience will improve.
How to continue using Java 17 or 21 with the Micronaut Framework?
If you need to use an older version, Micronaut Framework 4.x will continue to support Java 17 and Java 21.