visualvm icon indicating copy to clipboard operation
visualvm copied to clipboard

JDK 25 support

Open thurka opened this issue 4 months ago • 13 comments

Add support for upcoming JDK 25.

thurka avatar Sep 10 '25 09:09 thurka

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?

m-burst avatar Oct 01 '25 13:10 m-burst

Looking forward to it!

Image

youngledo avatar Oct 14 '25 07:10 youngledo

me too

ChristopherWirt avatar Oct 14 '25 11:10 ChristopherWirt

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.

visualvm_251017.zip

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.

Eiim avatar Oct 17 '25 04:10 Eiim

@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

youngledo avatar Oct 17 '25 13:10 youngledo

@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...

wzchamberlain-suez avatar Oct 26 '25 00:10 wzchamberlain-suez

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).

Eiim avatar Oct 26 '25 00:10 Eiim

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.

wzchamberlain-suez avatar Oct 27 '25 15:10 wzchamberlain-suez

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?

Marinell0 avatar Nov 19 '25 15:11 Marinell0

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).

Moresteck avatar Dec 01 '25 10:12 Moresteck

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"

reckart avatar Dec 01 '25 11:12 reckart

Image

Same here

realJustinLee avatar Dec 09 '25 08:12 realJustinLee

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.

bric3 avatar Dec 11 '25 11:12 bric3

@thurka Any plan for a new release that would include the support for JDK 25?

realJustinLee avatar Dec 16 '25 08:12 realJustinLee