Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where did jvisualvm go?

Tags:

java

macos

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?

like image 737
Laird Nelson Avatar asked Nov 09 '12 16:11

Laird Nelson


People also ask

Where can I find jvisualvm?

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:.”

How do I run jvisualvm on Windows?

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.

Does VisualVM work with Java 11?

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.

Is VisualVM included in JDK?

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.


2 Answers

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

like image 58
thanosa75 Avatar answered Sep 22 '22 00:09

thanosa75


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.d‌​mg

like image 40
kaimerra Avatar answered Sep 20 '22 00:09

kaimerra