Java 25 LTS: The New Features in JDK 25
Transcript:
Look what I've got here. All Ja ps of JDK 25. Let's open it up and see what the new LTS version brings us. Oh, look. Here's something that will accelerate the start of Java applications. Goodies from Project Leaden. Ahead of time command line ergonomics facilitates the creation of ahead of time cache. Instead of running two commands to create a cache, you can now run only one thanks to new command line option AOT cache output. Ahead of time method profiling extends the AOT cache introduced in JDK 24 to collect method profile during training runs. Now JVM has even less work to do at app start. So the app starts and reaches peak performance even faster.
Now that is something for better garbage collection. Generational mode of Shannondoa GC had become production ready. So you can use it in the enterprise app and get sustainably high throughput with reduced memory and power usage.
Wow, this is something exciting. Improvements to Java flight recorder to get even better measurements of your application performance. Wow, Swissmate must be very accurate. Java flight recorder can now use Linux kernel CPU timer to safely produce CPU time profiles of Java programs. Also, JFR cooperative sampling redesigns JFR sampling mechanism to parse thread stacks only at safe points but at the same time minimize the safe point bias.
The letter may affect the accuracy of profiling if often executed code is far from safe points. Anyway, this feature should promote safety and stability of profiling. Also, JFR now supports two new events, method timing and method trace. This way, developers can analyze method timing and tracing in testing and production easily and accurately.
Wow, I could have missed these ones. They are so tiny. These are compact object headers. They became production ready in JDK25. The size of the object header was reduced to 64 bits on 64-bit platforms, reducing CPU time and hip space. Flexible at start and locked solid when you apply it. That's stable values, ladies and gents. Stable values are objects holding a single data value. For instance, a logger. A stable value is initialized before its content is first retrieved. After that, it is immutable. This way they improve the startup time of Java apps thanks to deferred initialization and offer the same reliability of final fields.
Okay, this is something that can be sealed tight. That's scope values. Something to carry your data safely. Finalize. By the way, scope values carry immutable data that a method can share with its colleagues or child threats. They can help to increase code clarity and reliability. One package, multiple tool inside. Of course, that's module import declarations. Finalized developers can simply import a module and all module packages will be imported behind the scenes. Beginner and minimalist friendly.
Nice efficiency at its finest. Start small and work your way up to a complex program with compact source files and instance main methods. Finalized. By the way, this feature allows the developers who just started learning Java write single class programs with simplified syntax and expand them with time. Season devs will also like this feature as they can write small programs without extra complications. You know that is actually very useful. Flex it before enjoying your drink. And that's flexible constructor bodies finalized. With flexible constructor bodies, developers can initialize some fields or perform required computations in a constructor body before the constructor invocation. So no more boilerplate code in additional methods.
For hardcore security, no one will sneak into your system with new cryptographic capabilities. With a finalized key derivation function API, developers can use sophisticated cryptographic algorithms in Java code. In addition, Java 25 introduces a preview of a new API for converting between objects representing cryptographic keys and certificates and privacy enhanced mail transport format in a standardized and convenient way.
Wow, the yellow patterns finally have a cutter for every primitive type. Developers can now work with any type in patterns, instance of and switch. It means uniform data management, safe casts, and more lon code. Oh, structured concurrency. I need this one. I'm sick of threats scattered around in weird places. Think of a parent task as a magnet. It holds all subtasks tightly together in one place, waits for all of them to succeed, and monitors for failures. If one tasks failed, others are cancelled. You can clearly see the structure in the code.
Hmm I think I got this one last year and the year before that. Oh, it's the vector API. Well, maybe I will learn how to use it properly by the time it's finalized. Right now, the API for expressing multiple vector computations is being further refined. Let's wait for the introduction of project file hollow to the open GDK and then vector API will be promoted to preview. Hmm I guess that's it. Nothing more left. Where did the 32bit x86 port go? I suggest we take a minute and honor the memory of open GDK port to 32bit x86 machines. No new 32bit only x86 hardware is manufactured anymore. So, the community had to let the port go and remove its source code. JDK25 will see the light in September, but you can get early access builds to experiment with new features.
If you enjoyed this video and had fun with it, like, share, and of course, subscribe for more content like that. Until next time.





