Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreHi, Spring fans! Welcome to another extra special installment of This Week in Spring, wherein we celebrate a very auspicious day indeed: the release of Java 25 and GraalVM 25! That's right: an incredible new iteration of the JVM has just dropped and with it come a ton of features! Let's go through some of my favorites.
One nicety is the new Module import declarations - import all the packages in a given module with a new import
variant. (Does not require importer be in a module). So now you could do: import module java.base;
to get most of the core JDK types in your program in a single line. Easy!
And, finally, it can be said that Java supports Java.. scripts. That's right, Java scripts, the only good kind of Java... scripts!: This is one of my all time favorite new features! Finally, at long last, wayward students looking for salvation in a rough-n-tumble new language will find it: you can create hello world in 3 lines of code, as is true in most other languages! Here's a valid example:
Put this in script.java
:
void main(){
IO.println("Hello, Java 25!");
}
Then run it:
> java script.java
You could run Java source code files for years using the java <file>
construct. The new and novel feature here is that you can now create a program that doesn't have a public class and a public static void main
method. It couldn't be simpler. Notice that the main
method is the absolute minimum required: a return type, a name, and the usual parenthesis and curly-brackets. So nice!
The new AOT support for method profiling is here, too, and allows the existing AOT machinery to now compute new native code for fast native methods on startup, immediately, instead of waiting for method profiling. The AOT caches other things, like classes that it'll need to load and link, so this is just an extension of an already useful set of features.
And of course there are a million other smaller features that I'm looking forward to. Get the bits and try it out! I use the amazing SDKMAN.io version manager, and it's trivial to upgrade versions from there!
And, you can expect support on the Spring Initializr for Java 25 hopefully very soon, of course!
Let's dive right into this week's roundup, as always, there's a lot to it!
@ConcurrencyLimit
, @Retryable
, and RetryTemplate
?gpt-oss