Java 25 Features Explained: All 18 JEPs in the Last LTS Release
Java 25 has been a major release in Java history for many reasons. But to understand this, just providing a long list of items mentioning all the approved JEPs is not enough. We will explore Java 25 features by category and will dig deeper into every feature to help you understand what changed from the previous version or what new features have been introduced.
The way we organize the Java 25 features follows the same way OpenJDK organizes its work behind the features before the release. So, you will see either the features are organized by different OpenJDK projects like Amber, Loom, Panama, and Leyden or as per practical relevance.

A Quick Glance at the Java 25 Release
| Detail | Value |
| General availability | Publicly available since September 16, 2025 |
| Release type | Long-Term Support (LTS) Release |
| Predecessor LTS | Java 21 (Released in September 2023) |
| Next feature release | Java 26 (To be released in March 2026) |
| Total JEPs delivered | Total 18 JEPs |
| Finalized features | Total 7 features are finalized they passed preview or incubation through previous versions |
| Features on Preview or incubator | 11 features are introduced as preview |
Java 25 Features That are Most Impactful
Instead of going all out into all 18 Java 25 features, we should rather pick a short list of most impactful features, the handful of features that are likely to change the way Java code will be written by developers from now onwards or the features that are going to impact the existing Java app performance significantly. Let’s quickly grasp this shortlist.
- Compact Source Files and Instance Main Methods (JEP 512): This helps Java learners and beginners to write code quickly without errors. It is also likely to help developers write programs faster.
- Module Import Declarations (JEP 511): This new feature will help trimming the code by slashing down the import boilerplate.
- Flexible Constructor Bodies (JEP 513): The restriction for
ordering constructors that stood as an obstruction, has been removed through the
introduction of this feature.
- Compact Object Headers (JEP 519): This new feature will
enable developers to boost memory and improve application performance without
any code changes.
- Scoped Values (JEP 506): This has been introduced as the alternative to ThreadLocal, and it is an important value addition to handle virtual-thread-heavy code.
Apart from the above mentioned shortlist of features, all others either fall in the category of preview or incubator features or ones that the vast majority of application code does not handle directly.
Now we would explain all features based on the projects they came from or their relevance.
Language Features (Project Amber)
OpenJDK’s Project Amber deals with the small changes of the Java language that are likely to boost developer productivity. Java 25 comes with 4 such features related directly to the way Java code is written.
Compact Source Files and Instance Main Methods (JEP 512): This feature has undergone four rounds of preview starting from Java 21 to 24, before being finalized. This is the most lucrative feature in this release for beginners or developers who need to write small scripts. It reduces the coding time and complexity by removing class declaration as an obligation from writing a program script. Developers and new Java learners now can write a full script without declaring class, and also without static, and String[] args. Here’s an example:
void main() {
IO.println("Hello, World!");
}
After writing the code following this new method, the compiler automatically wraps the code in a final, top-level class without any name, and this takes place silently behind the scenes. To help with the new, easier entry-level method, a new IO helper class has been introduced in java.lang. This new language-level change does not impact the traditional public static void main(String[] args) programs; they continue to work as usual.
Module Import Declarations (JEP 511): Module Import Declaration has been introduced to go hand in hand with compact source files. The purpose of this feature is to import all classes exported by a module rather than importing single individual classes one at a time. Here’s how it works:
import module java.base;
void main() {
List names = List.of("Alex", "Priya", "Sam");
names.forEach(IO::println);
}
Observe how it incorporates List, alongside all the rest of the packages of java.base. While doing so, it doesn’t create many footprints, such as the long sequence of single import statements. It can reduce the clutter from imported classes and packages, which is very helpful for developers to write clean and straightforward short program scripts.
Flexible Constructor Bodies (JEP 513): A stringent rule that has existed through every Java version has been relaxed, much to the delight of developers. In a constructor, a call to super() or this() must appear as the literal first statement. Java 25 removes this obligation. To invoke the superclass constructor, developers find it easier to validate or build constructor arguments. Here’s how it works:
package roseindia.net;
class Rectangle {
Rectangle(int width, int height) {
if (width <= 0 || height <= 0) {
throw new IllegalArgumentException("Dimensions must be positive");
}
super();
// remaining initialization
}
}
Primitive Types in Patterns, instanceof, and switch (JEP 507): OpenJDK experimented with pattern matching through three preview rounds before finalizing it with Java 25. Now Java's pattern matching works not only with reference types but also directly with primitive types. This allows switch expressions and instanceof checks to match against primitives such as int and double while doing away with the manual boxing. This new pattern matching feature also fits into the record patterns introduced by previous Java releases.
Concurrency Features (Project Loom)
Project Loom continued its focus on concurrency features, and it did not stop with introducing virtual threads with Java 21. Java 25 further released two closely related features focused on concurrency.
Structured Concurrency (JEP 505): This feature has been introduced as a preview by Java 25 for the fifth time. Thanks to this, multiple related concurrent subtasks can be organized into a group representing a single unit of work and a common lifecycle. Because of this shared lifecycle, the failure of one subtask or cancellation of the parent task automatically results in the cancellation of all other subtasks in that group. This new subtask grouping with a common lifecycle ensures that any failure in a concurrent operation cannot keep the sibling tasks running only to cause disruption or leaks at a later stage.
Scoped Values (JEP 506): After going through one incubation and four preview rounds, it has been finalized in Java 25. This feature can help define scope better and prevent memory leaks by providing a safer and more organized alternative to ThreadLocal. Unlike ThreadLocal, which is mutable, it allows sharing immutable data within a thread and across multiple threads. Since scope values are immutable, there is less scope for leaks and help prevent bugs generated from the mutable threads.
High-Performance Computing (Project Panama)
Project Panama is dedicated to working on features for high-performance computing such as the Vector API.
Vector API (JEP 508): For the 10th time, this feature has been introduced as an incubation feature in Java 25. Compared to its introduction in Java 24, this time it does not bring any significant changes to the API or its implementation. The objective of the API is to help developers express vector computations which are extremely relevant to handle CPU workloads for rigorous numerical computing, data analytics, and AI-powered tasks. Oracle already made it clear that this API will remain in incubation until certain features from Project Valhalla, such as value objects, are released as a preview. As the value objects feature is officially set to be released as a preview in the upcoming JDK 28, it is expected that the Vector API is going to be finalized in the next LTS release.
Faster Startup Times (Project Leyden)
Project Leyden works on features to boost the usual startup-time and warmup-time cost of the Java platform. It is important to mention here that there is a sustained criticism about the comparatively higher cost of startup-time and warmup-time for the Java platform in contrast to other alternatives that are statically compiled.
Ahead-of-Time Command-Line Ergonomics (JEP 514): Introduced already in Java 24, this preview-level Java 25 feature makes creating any ahead-of-time (AOT) cache easier and simplified. The feature simplifies cache creation simply by condensing multiple detailed steps into one command-line flow. This is particularly effective in reducing the startup time barrier for the vast majority of common use cases.
Ahead-of-Time Method Profiling (JEP 515): This preview-level feature advances the startup time boosting capabilities further by profiling specific execution methods from previous run instances and making them available every time the JVM is started.
Security Library Enhancements
In Java 25, two new JEPs have been introduced to equip Java's APIs used for cryptographic operations.
PEM Encodings of Cryptographic Objects (JEP 470): This preview-level feature, through a standard API, introduced the PEM text format to encode and decode cryptographic keys, certificates, and certificate revocation lists. Thanks to this feature, developers no longer need to rely on third-party libraries for complex encoding and decoding tasks related to cryptographic files.
Key Derivation Function API (JEP 510): This feature has been finalized in Java 25, just following its first preview round in Java 24. It created a standardized way to leverage Key Derivation Functions (KDFs). Key Derivation Function is an algorithmic function to encode or decode cryptographic keys and other cryptographic data to and from a secret key.
JVM and Runtime Improvements (HotSpot)
Most new features of Java 25 18 fall in this category.
Compact Object Headers (JEP 519): This JVM feature is created to boost performance without needing the developers to change or add a single line of code. The metadata-carrying object headers in the JVM that used to take from 96 to 128 bits of space have been shrieked down to 64 bits on 64-bit architectures. This will help reduce the memory footprint and resulting CPU workload from applications creating a load of small objects.
Generational Shenandoah (JEP 521): This is about introducing generational mode for the Shenandoah collector. Now, from Java 25, the generational mode for the Shenandoah garbage collector gets complete support, and it is ready to work in a production-ready environment. But still, the generational mode has not been made default for Shenandoah, and for that we have to wait for the Java 28 release.
Remove the 32-bit x86 Port (JEP 503): Finally, Java completely removed support for 32-bit x86 systems. It was a very much expected step since 64-bit hardware has already been the norm for almost the entire industry.
JFR CPU-Time Profiling (JEP 509, Experimental, Linux-only): This has been released as an experimental feature. The objective of this feature is to add samples of CPU-time profiles to Java Flight Recorder, an integrated profiling and diagnostics tool of the Java platform.
JFR Cooperative Sampling (JEP 518): This is another feature related to Java’s diagnostic toolkit, Java Flight Recorder. It organizes thread samples into stacks and prevents external exposure, enhancing overall safety and precision of the stack-sampling process of the tool.
0JFR Method Timing & Tracing (JEP 520): This new feature has been introduced in Java 25 to record methods and tracing events with direct timestamps in the Java Flight Recorder. Thanks to this, developers can now check method execution time directly without needing to rely on a separate tool.
JEP 470-521: A Complete List of JEPs Under Java 25
| JEP | Name | Status | Category |
| 470 | PEM Encodings of Cryptographic Objects | Preview | Security Library |
| 502 | Stable Values | Preview | Core Library |
| 503 | Remove the 32-bit x86 Port | Finalized | HotSpot |
| 505 | Structured Concurrency | 5th Preview | Core Library |
| 506 | Scoped Values | Finalized | Core Library |
| 507 | Primitive Types in Patterns, instanceof, switch | 3rd Preview | Language |
| 508 | Vector API | 10th Incubator | Core Library |
| 509 | JFR CPU-Time Profiling | Experimental | HotSpot |
| 510 | Key Derivation Function API | Finalized | Security Library |
| 511 | Module Import Declarations | Finalized | Language |
| 512 | Compact Source Files and Instance Main Methods | Finalized | Language |
| 513 | Flexible Constructor Bodies | Finalized | Language |
| 514 | Ahead-of-Time Command-Line Ergonomics | Finalized | HotSpot |
| 515 | Ahead-of-Time Method Profiling | Finalized | HotSpot |
| 518 | JFR Cooperative Sampling | Finalized | HotSpot |
| 519 | Compact Object Headers | Finalized | HotSpot |
| 520 | JFR Method Timing & Tracing | Finalized | HotSpot |
| 521 | Generational Shenandoah | Finalized | HotSpot |
What Really Changed Between Java 21 & Java 25?
As a user of Java 21, which was the LTS version preceding Java 25, if you are asking what actually changed between these two LTS releases, this list of differences might be helpful to you.
| Area | Java 21 (2023) | Java 25 (2025) |
| Beginner syntax | Traditional public static void main only | Compact source files with void main() (JEP 512) |
| Concurrency | Virtual threads feature is finalized & new scoped values feature in incubation | Scoped values finalized (JEP 506) and structured concurrency is introduced as 5th preview (JEP 505) |
| Object memory overhead | Standard 96-bit to 128-bit object headers | Object headers with compact metadata, 64 bits (JEP 519), without needing any code change |
| Garbage collection | G1 default, while Shenandoah and ZGC have no generational support for Shenandoah | Generational support for Shenandoah has been introduced (JEP 521) |
| Pattern matching | Record patterns finalized | Pattern matching is available for primitive types (JEP 507, a preview feature) |
| Imports | Only explicit import of a single class | Module-level imports of multiple classes available (JEP 511) |
| Cryptography | Key Encapsulation Mechanism API added | PEM encoding API (preview) and Key Derivation Function API finalized |
Final Thoughts
If you have read the article this far, you must have understood that the 18 JEPs of Java 25 represent a much broader trajectory than just a bullet-point list. The broader changes that Java 25 brought start with simplifying the scripting for beginners, and it advances by introducing features around structured concurrency, taking steps to reduce memory footprint and CPU workload, and finally by modernizing APIs for cryptographic data handling. No wonder Java 25 is already regarded as a milestone release, even among recent LTS versions.
1Related Tutorials: