I installed OpenJDK 8 on Ubuntu using sudo apt-get install openjdk-8-jdk
, and it was installed to /usr/lib/jvm/java-8-openjdk-amd64
.
Where can I find the Java Mission Control (I think called jmc
) and VisualVM (I think called jvisualvm
) programs?
I assumed both to be installed with the JDK:
What am I missing? Are both only part of the Oracle JDK, or did I use the wrong install command?
If they are not part of the OpenJDK, can I download them using apt-get install
?
Neither in Ubuntu nor in Debian the tool visualvm is part of the OpenJDK 7 package. It's part of the Oracle JDK 7 and seems to be GPL licensed. While in Ubuntu it can be installed with a separate package, such a package doesn't exist in Debian.
What is VisualVM. It is a tool automatically available after JDK is installed. The executable file could be found on your <JDK installation folder>/bin as displayed below. In order to measure the performance of your application, it is necessary for the application to be recognized by VisualVM first.
OpenJDK contains a simple tool called jfr that allows you to read JFR recordings and get useful metrics from them.
Some OpenJDK distribution maintainers are now providing jmc builds like AdoptOpenJDK, Amazon Corretto or Azul Zulu.
Java Mission Control (jmc) is open source and hosted on GitHub and openjdk.java.net (as a Mercurial repository).
Official nightly builds are available here.
It is also rather easy to build jmc yourself using the instructions from the readme file:
hg clone http://hg.openjdk.java.net/jmc/jmc/
cd jmc/releng/third-party
mvn p2:site
mvn jetty:run
In a different terminal:
cd core
mvn clean install
cd ..
mvn package
After installing, you can close the Jetty server running in the first terminal.
Alternatively, you can use Docker to build jmc:
docker-compose -f docker/docker-compose.yml run jmc
To launch jmc:
target/products/org.openjdk.jmc/linux/gtk/x86_64/jmc
target/products/org.openjdk.jmc/macosx/cocoa/x86_64/JDK\ Mission\ Control.app/Contents/MacOS/jmc
target\products\org.openjdk.jmc\win32\win32\x86_64\jmc.exe
You should see a splash screen now:
More info in this blog post.
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