Blog
July 28, 2025
Oracle is slated to release Java 25, the latest long-term support (LTS) release, on September 16. In the meantime, the release candidate is available for early access and is packed with exciting features and enhancements aimed at improving developer productivity, application performance, and the overall Java ecosystem.
Keep reading for a breakdown of what new features are included in Java 25, what these features mean for Java developers, and what the latest Java LTS version means for the entire Java ecosystem.
What is Java 25?
Java 25 is the latest LTS release of the JDK and is scheduled for general availability in September 2025. There are 18 proposed permanent, preview, incubator, and experimental features in Java 25.
What Is a JEP and Why Does it Matter?
JEP stands for Java development kit enhancement proposal. JEPs are a formalized method for adding new features to the Java language on a preliminary, preview, or permanent basis.
Further, there are four different kinds of JEPs in Java 25:
- Experimental JEPs are early versions of mostly VM-level features and can be incomplete, unstable, or otherwise risky. Experimental JEPs should be enabled using dedicated flags to turn them on. JFR CPU-Time Profiling (JEP 509) is an experimental JEP in Java 25.
- Incubator JEPs are a means of putting not-yet-final tools and APIs in the hands of developers while those tools and APIs progress toward either finalization or permanent removal in a future release. Incubator JEPs are a good way to test new features today, but put them into production at your own risk. Vector API (JEP 508, 10th incubator) is the sole incubator JEP in Java 21.
- Preview JEPs are features for which the design, specification, and implementation is finalized but not yet permanent, which means that they may yet be changed or removed at a future release. Preview JEPs must also be specifically enabled to be used. PEM Encodings of Cryptographic Objects (JEP 470), Stable Values (JEP 502), Structured Concurrency (JEP 505, 5th preview), and Primitive Types in Patterns, instanceof, and switch (JEP 507, 3rd preview) are included in Java 25.
- Permanent JEPs are not an official title from Oracle, but they are JEPs that have appeared in previous JDK releases and have been refined via user feedback. Because Java 25 is a Java LTS version, it contains a preponderance of permanent JEPs.
Key Features in Java 25
Java 25 adds a suite of new features aimed at making the language expressive, modern, flexible, and performance ready.
This release introduces practical features like flexible constructor bodies and compact source files, which help reduce unnecessary code and make syntax modern. Expanded pattern matching and AOT method profiling enhance both code clarity and runtime efficiency. Module import declarations make it simpler to organize and maintain large codebases.
These changes show that Java is actively evolving to meet modern development needs rather than just following trends. There will be a significant impact of these & upcoming changes, Developers will be more productive as they will spend less time writing repetitive boilerplate code and more time solving real problems. Meanwhile, applications will perform faster and be easier to maintain.
Overall, Java 25 represents a major step forward that ensures the language remains relevant and competitive in today's fast-moving technology landscape. Read on to learn more about five features that piqued my interest.
Flexible Constructor Bodies (JEP 513)
This feature was previewed in Java 22, Java 23, and Java 24; it is now a permanent feature in Java 25. Flexible Constructor Bodies allow you to write code before calling super() or this() and relaxing the rules around how and when final fields can be initialized.
This means you no longer have to restructure code just to comply with rigid constructor flow rules, which is a clear win for readability and maintainability, especially useful in scenarios involving conditional initialization or validation logic prior to superclass construction.
Example:
public class Customer {
final UUID customerId;
final String email;
public Customer(String email) {
// Validate email format before object creation
if (!isValidEmail(email)) throw new ValidationException("Invalid email format");
super();
//rest of code
}
}
Primitive Types in Patterns (JEP 507)
With Java 25, pattern matching now works with all primitive types such as int, long, and double; previously it was limited to reference types only. This change brings consistency to Java’s pattern matching model, letting developers use instanceof and switch more effectively across all data types.
This enhancement makes code cleaner without compromising on performance, which is great for those working in performance-critical domains like analytics, finance, or streaming data processing.
Example:
switch (x) {
case int i -> System.out.println("Int value: " + i);
case double d -> System.out.println("Double value: " + d);
}
Compact Source Files and Instance Main Methods (JEP 512)
Java 25 simplifies source files by allowing top-level class declarations without the public modifier, import common java.base packages by default, declare main as an instance method, and use streamlined console I/O.
Because of these modifications, Java is now more accessible to newbies, script writers, and tool developers. Compact source files and instance main methods also means faster prototypes and less difficulty when creating small utilities or test drivers, without sacrificing Java's structure or readability.
Example:
class Hello {
void main() {
System.out.println("Hello from an instance main!");
}
}
Module Import Declarations (JEP 511)
In Java 25, you can now use import module to explicitly import named modules using import module, which makes dependencies visible within the source file instead of concealed in module-info.java. Declaring module usage in your source files streamlines the maintenance, refactoring, and even the static analysis processes.
This change will be useful in plugin architectures, SDKs, and even Java applications that are built with JPMS (Java Platform Module System).
Example:
import module com.company.order; //Single module import
public class OrderController {
// All exported types from order module available
OrderService orderService;
OrderValidator validator;
// etc.
}
Ahead-of-Time (AOT) Method Profiling (JEP 515)
This feature of Java 25 is profiling method behavior in advance and reusing that data to improve JIT compilation performance. Methods can be optimized base on pre-recorded usage patterns which significantly reduces warm-up time.
For short-lived cloud applications, microservices and serverless functions, this means faster cold starts and more predictable runtime performance. It also opens the door to more consistent tuning for production workloads where startup time directly impacts SLA or cost.
What JEPs are Included in Java 25
The full list of proposed JEPs for Java 25 is as follows:
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
Back to topWhy Upgrade to Java 25?
As an LTS release, Java 25 offers at least five years of premier support, making it a stable choice for production environments. It builds on the innovations of previous versions while introducing new capabilities that enhance developer productivity and application performance.
Whether you're a seasoned Java developer or just starting, Java 25 has something for everyone. From simplified syntax for beginners to advanced APIs for professionals, this release is a testament to Java's ongoing evolution.
Back to topFinal Thoughts
Java 25 is full of new features, many of which support faster and more efficient Java development. Tooling throughout the Java community will likely expedite adding support for Java 25 due to the fact that it is a long-term support version.
Tools like JRebel have consistently been the first to add support for Java LTS releases (JRebel support is expected to release on October 7). Compound those time savings by using JRebel, which eliminates time-consuming rebuilds and redeploys that disrupt your development workflow.