Saturday, February 1, 2014

How to Find Java Mission Control on OSX 10.9

i was excited to show some of my colleagues how great Java Mission Control is to debug, troubleshoot and monitor local and remote Java applications. On my OSX 10.9 laptop i installed the latest Oracle JDK 7, which now includes Java Mission Control with the JDK, and i expected to be able to type jmc on the command line. that didn't work and resulted in a command not found! OSX Finder wouldn't find jmc it either. i found a hint on an OTN community thread. the Java installer only put installation files in the obscure and hard to find /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/ instead of also placing a shortcut in /usr/local/bin which should link to /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/jmc that should change when you use /usr/libexec/java_home. you can see the install location by running this command:
$ find /Library/Java -name jmc
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/jmc
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/missioncontrol/Java Mission Control.app/Contents/MacOS/jmc

the solution i chose was to create this executable file in /usr/local/bin/jmc

#!/bin/bash

/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/jmc

maybe it's because i had JDK 7 installed originally before Mission Control was included with it. i'm not sure, but i hope this helps someone else.

3 comments:

Andy Piper said...

Seems to work for me without that script - jmc at the shell brings it right up.

... not that i know what to do with it (yet) - I'm slightly amused that it is an Eclipse RCP app though!

Seth Williams said...

Java Mission Control is indeed very useful when debugging java applications. If you want to know about training courses in Java, you can visit this link.
http://www.fireboxtraining.com/java

K Sarah said...

Java Mission Control is an advanced set of tools that enables efficient and detailed analysis of the extensive of data collected by Java Flight Recorder. The tool chain enables developers and administrators to collect and analyze data from Java applications running locally or deployed in production environments.
Here is MN web designer profile from Minneapolis web design firm!