JDK 25 support
Add support for upcoming JDK 25.
Hi @thurka,
Java 25 has been released, but latest VisualVM still doesn't support it. Are there any plans for a release with Java 25 support?
Looking forward to it!
me too
Since it's been over a month since Java 25 released and Oracle hasn't bothered to push an update, I went ahead and built it myself. I'll attach it here for anyone else who might need it.
Fair warning, there's every chance I did something wrong since I've never built this project before and I basically haven't tested it, but it seems to work.
@thurka There are too many "if..else" judgments; is it really necessary to do it this way? If an incompatible version does occur, can we raise an issue on GitHub?
https://github.com/oracle/visualvm/commit/ec49eef08355dcc473dbff04885df19e75a1f8e7
@Eiim Can you detail what you had to change to build for Java 25 or provide a fork?
I have a need for JDK 25 support but am running into version related compile errors when attempting to build off of master myself. These errors appear to come from the netbeans platform, if that helps your recollection...
I did not change any source code. Make sure you're building with Java 8. I had some problems with getting it to use 8 instead of 25, so I grabbed an Ubuntu VM that wasn't running Java, installed Java 8, and it built fine (including Windows binaries).
Thanks for the speedy reply @Eiim , I was expecting to need to compile of Java 25 for support forgetting about Java's backwards compatibility quirks. Building with Java 8 and then running with Java 25 worked.
So, we had the Java 25 support added to main for 2 months now (by commit ec49eef)
Is there gonna be a release for that?
Can VisualVM be updated to feature the Java 25 support commit already? Even a 2.2.1 would suffice. 2.2 is unusable for me because it insists on using JDK 25 when I set JDK 21 as default on macOS.
I tried installing JDK 21 after 25 and that didn't help, VisualVM still insists on using JDK 25. I imagine I would have to uninstall JDK 25 whenever I want to use VisualVM, and that's Not an acceptable solution/workaround for me.
Edit: I made it work by editing visualvm.conf which for some reason is located within the .app (not really ideal).
You need to start it with --jdkhome.
If you are on macOS, try on the command line:
cd /Applications/VisualVM.app/Contents/MacOS
export JAVA_HOME="$(/usr/libexec/java_home -v 24)"
./visualvm --jdkhome "$JAVA_HOME"
Same here
Got the same.
If this happen again one can patch the app this way, thus avoiding to run it via cli.
In /Applications/VisualVM.app/Contents/Resources/visualvm/etc/visualvm.conf, there's a section to pass the JDK HOME, e.g.
# Default location of JDK:
#
# It can be overridden on command line by using --jdkhome <dir>
# Be careful when changing jdkhome.
# There are two VisualVM launchers for Windows (32-bit and 64-bit) and
# installer points to one of those in the VisualVM application shortcut
# based on the Java version selected at installation time.
#
visualvm_jdkhome=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
It will likely be overwritten on the next update though, or if the path to the JDK home changes for some reason. But that's ok as a workaround until next version is published.
@thurka Any plan for a new release that would include the support for JDK 25?