I am running Mac OSX Snow Leopard.
I've always updated Java using the regular Software Update features of Mac OSX.
I've used the Java jvisualvm
tool in the past with great success.
This morning I typed jvisualvm
into the command line as I often do. I got the following error:
$ jvisualvm Unable to locate an executable at "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/jvisualvm" (-1)
All of the other Java tools (java
, javac
, jps
, etc.) work just fine.
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin
indeed does not contain jvisualvm
(all of a sudden).
/usr/libexec/java_home
yields:
$ /usr/libexec/java_home /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
WTF?
Once you are in the bin directory of JDK, you will find jVisualVM.exe; just click on it, and the application starts up. You can see all the running Java applications on the left pane of the interface. While setting up the remote application, you can give it name as well, “Display name:.”
You can access VisualVM from the bin directory of the JDK: On a Windows system, start VisualVM by double-clicking jvisualvm.exe. You can also select VisualVM from the Start menu (if Windchill shortcuts are installed). On other systems, start VisualVM by invoking the jvisualvm script.
Use VisualVM bundled with GraalVMGraalVM contains a fully compliant Java SE 8, Java SE 11, and Java SE 17 JDK distribution based on Oracle JDK and OpenJDK. It features an innovative JIT compiler which may noticeably improve performance of Java applications, compared to the standard Oracle JDK or OpenJDK.
Various optional tools, including Java VisualVM, are provided with the Java Development Kit (JDK) for retrieving different types of data about running JVM software instances.
Seems like a mixup of links; the /usr/bin/jvisualvm symlink points to something that does not exist (as people pointed out above). Apparently the jvisualvm executable (stub) exists and the way to fix this for now is to execute:
cd /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin sudo ln -s /System/Library/Java/Support/VisualVM.bundle/Contents/Home/bin/jvisualvm .
This requires sudo privileges and creates the missing symlink, pointing to the VisualVM bundle. No idea why it happened but upgrading to latest XCode 4.5.2 did not fix this for me automatically. I am running MacOS X 10.7.5 and java 1.6.0_37
It seems the supporting bundle got removed upon update. https://discussions.apple.com/thread/4474992?start=0&tstart=0
Download the bundle to use as a workaround. http://visualvm.java.net/download.html
EDIT:
Use this download link: https://java.net/projects/visualvm/downloads/download/release132/VisualVM_132.dmg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With