OpenJDK JDK11 not having JMC- Java Mission Controller- FlightRecorder

Viewed 15962

I was hoping JMC would be available with OpenJDK, JDK11 binaries as this has been opensourced from Java 11 by oracle, but could not locate this in Oracle and AdoptOpenJDK Java-11 binaries under bin folder. I have also tried this https://jdk.java.net/jmc/ as some article said its being releases separately. Does anyone know how to get JMC for OpenJDK-11.

6 Answers

I am editing this answer since builds are now available, and have been available, from multiple vendors for quite some time. The list is available in the readme for the JMC GitHub repo:

https://github.com/openjdk/jmc

Don't forget to give the project a star if you like it! :)

Here is the original answer:

Normally the builds will be available here: https://jdk.java.net/jmc/

See http://hirt.se/blog/?p=1007 for more information on the new delivery format.

The builds have been (temporarily) pulled because a switch from the old javax.mail coordinates to the new coordinates at jakarta-ee has not yet gotten the proper third-party approval. A new build, with plenty of fixes and with all the approvals properly in place (or a revert of the change), should be along within the next few weeks.

Up until then it is possible (also not hard) to build JMC 7, by pulling the official JMC repo from here: https://hg.openjdk.java.net/jmc/jmc7/

You can also build and pull the mainline mirror from the inofficial GitHub repo: https://github.com/JDKMissionControl/jmc

For more information on building JMC, see: http://hirt.se/blog/?p=947 (or simply read the README.md in the repository root)

Good luck!

Update

JMC 8 available when compiling it from source. Here is a single command for linux users to build your own copy of jmc

mkdir ~/jmcToDelete && \
cd ~/jmcToDelete && \
git clone https://github.com/openjdk/jmc.git && \
cd jmc/releng/third-party && \
mvn p2:site && \
runJetty="mvn jetty:run" && \
bash -c "$runJetty &" && \
cd ~/jmcToDelete/jmc/core && \
mvn clean install && \
cd ~/jmcToDelete/jmc && \
mvn package -Dmaven.test.skip=true && \
kill $(jps | grep Launcher | awk '{print $1}') && \
sudo mkdir -p /opt/java/jmc && \
sudo tar xzf  $(find ~/jmcToDelete/jmc/target -name '*.jmc-linux*') -C /opt/java/jmc  && \
sudo ln -s  /opt/java/jmc/jmc   /usr/local/bin/jmc  && \
rm -rf ~/jmcToDelete

typing jmc in a terminal should start it.

Outdated

As stated by Hirt you can compile it from http://hg.openjdk.java.net/jmc The jmc available in jdk8 (v5.5) requires the special flags -XX:+UnlockCommercialFeatures -XX:+FlightRecorder to be present in the JVM process and it will not retrieve "flight records" if they are not there, so you can only use it with java1.8. If you would like to add those flags on openjdk-11 it will fail with Unrecognized VM option 'UnlockCommercialFeatures' meaning that you don't need them as they are enabled by default ( FlightRecorder ).

I compiled jmc-7.1.0 without issues by downloading the gz archive from http://hg.openjdk.java.net/jmc/jmc/ Follow the steps present in the README file: Make sure the compilation is done with jdk1.8 In one terminal :

cd releng/third-party
mvn p2:site
mvn jetty:run

And in the second terminal:

cd core
mvn clean install
cd ..
mvn package

On completion you should have all your artefacts in the target folder. The default jmc start script has a lot of flags present and it will not start with all of them, hence you can start the intended jar using

java -jar ./jmc-[...]/target/products/jmc/plugins/org.eclipse.equinox.launcher_[...].jar

BellSoft provides Liberica Mission Control: https://bell-sw.com/pages/lmc/

As per their documentation, it's free to use in production environments, and there is a commercial support included as part of Support Subscription for Liberica JDK.

Related