Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to find Java Mission Control and VisualVM on Ubuntu (OpenJDK 8)?

Tags:

java

jvm

ubuntu

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:

  • The Java Mission Control page states that "Starting with the release of Oracle JDK 7 Update 40 (7u40), Java Mission Control is bundled with the HotSpot JVM."
  • The VisualVM page says "March 18th, 2014: JDK 8 has been released and is available for download here. It contains Java VisualVM tool based on VisualVM 1.3.6."

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?

like image 550
Markus Weninger Avatar asked Apr 07 '16 17:04

Markus Weninger


People also ask

Is VisualVM included in OpenJDK?

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.

Where is VisualVM EXE located?

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.

Is Jfr available for OpenJDK?

OpenJDK contains a simple tool called jfr that allows you to read JFR recordings and get useful metrics from them.


1 Answers

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:

  • on Linux: target/products/org.openjdk.jmc/linux/gtk/x86_64/jmc
  • on macOS: target/products/org.openjdk.jmc/macosx/cocoa/x86_64/JDK\ Mission\ Control.app/Contents/MacOS/jmc
  • on Windows: target\products\org.openjdk.jmc\win32\win32\x86_64\jmc.exe

You should see a splash screen now:

splash_screen_of_java_mission_control


More info in this blog post.

like image 95
Steven Avatar answered Oct 15 '22 10:10

Steven