29

I'm trying to launch Java Mission Control as provided in the JDK 1.8.0_161 on Mac OS X High Sierra (10.13.2, with Supplemental Update of January 2018) and the JMC application is frozen, i.e. I'm unable to browse in the JVM Browser panel.

As I've other former JDK installed, therefore I've checked JMC with the following versions with success:

  • 1.8.0_121
  • 1.8.0_144
  • 1.8.0_151

So the problem is very specific to the JDK 1.8.0_161.

(To see your JDKs, run the command /usr/libexec/java_home -V)

(To run a former JMC, i.e. /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/jmc)

As a side verification, I've run the JMC of the JDK 1.8.0_161 on Windows 10 with success.

So do you experience the same issue ?

Is there some settings to tweak to have it working ? (E.g. would it be an issue related to Mac OS X Gatekeeper !?)

And how to report it to Oracle properly ... I've searched their bug database without success, and when I try to submit a bug, I cannot figure which would be the right subcategory (c.f. https://bugreport.java.com/submit_intro.do), as JMC is not listed in the TOOLS section ... Any advice !?

Frédéric
  • 565
  • 1
  • 5
  • 10

4 Answers4

47

There's a workaround for this, as mentioned by @jwatkins in a comment.

  1. Download the swt cocoa jar from here.
  2. Go to JDKs jmc path (You can find this path by right-clicking on jmc icon in the dock -> Options -> Show in Finder, Then right click on App -> Show Package Contents).

    • For example: cd /Library/Java/JavaVirtualMachines/jdk<version>.jdk/Contents/Home/lib/missioncontrol
  3. Back up exisiting jar using sudo mv plugins/org.eclipse.swt.cocoa.macosx.x86_64_3.103.1.v20140903-1947.jar ../

  4. Copy downloaded zip's swt.jar using sudo cp ~/Downloads/swt.jar plugins/org.eclipse.swt.cocoa.macosx.x86_64_3.103.1.v20140903-1947.jar
  5. Restart jmc

NOTE: Remember! your new copied jar file's name should be exactly as the old one(it uses OSGi bundles.info to load jars)

Govinnage Rasika Perera
  • 2,134
  • 1
  • 21
  • 33
  • I have jdk 1.8.0_202, it does not have "org.eclipse.swt.cocoa.macosx.x86_64_3.103.1.v20140903-1947.jar" ⇒ ls plugins/org.eclipse.swt.cocoa.macosx* plugins/org.eclipse.swt.cocoa.macosx.nl_ja_4.4.0.v20140623020002.jar plugins/org.eclipse.swt.cocoa.macosx.x86_64.nl_ja_4.4.0.v20140623020002.jar plugins/org.eclipse.swt.cocoa.macosx.nl_zh_4.4.0.v20140623020002.jar plugins/org.eclipse.swt.cocoa.macosx.x86_64.nl_zh_4.4.0.v20140623020002.jar – Suchak Jani Feb 07 '19 at 09:45
  • The plugins seems to have version #s that cause the start to fail when you copy in a replacement jar – Kirk Feb 11 '19 at 22:24
  • 1
    The link in step one does return but all of the mirrors I've tried 404. Used this instead: https://search.maven.org/search?q=g:org.eclipse.platform%20AND%20a:org.eclipse.swt.cocoa.macosx.x86_64&core=gav and downloaded the lastest (3.109 in my case). Worked! – Roy Truelove Feb 20 '19 at 22:36
  • This worked for me on 1.8.0_202 after replacing org.eclipse.swt.cocoa.macosx.x86_64_3.103.1.v20140903-1947.jar – abbas Jul 10 '19 at 13:09
  • JMC is now working but I am getting this exception when loading a JFR file java.lang.ClassCastException: org.eclipse.swt.layout.GridData cannot be cast to org.eclipse.swt.layout.FillData at org.eclipse.swt.layout.FillLayout.flushCache(FillLayout.java:176) at org.eclipse.swt.widgets.Composite.layout(Composite.java:870) at org.eclipse.swt.widgets.Control.requestLayout(Control.java:2847) at org.eclipse.swt.custom.CTabFolder.destroyItem(CTabFolder.java:816) at org.eclipse.swt.custom.CTabItem.dispose(CTabItem.java:130) – abbas Jul 10 '19 at 14:10
  • 6
    I fixed the exception with version 3.108.0 of SWT. The latest versions were buggy for me. – abbas Jul 10 '19 at 14:23
  • That issue might be due to api changes – Govinnage Rasika Perera Aug 03 '19 at 00:44
  • 1
    Worked for me jdk v1.8.0_211. Used the 3.108.0 version of the jar. Thanks @RasikaPerera – menaka_ Sep 13 '19 at 05:03
26

This is unfortunately a bug that we recently discovered, caused by incompatibilities between old Eclipse/SWT versions and new fixes done in JDK 8u152 (backported from JDK 9).

Workaround is to run older version of JDK 8, or the latest version of JDK 7 (which includes the same version of JMC). JDK 9 also works, with the new JMC 6 included.

(Oracle Internal) bug reference: JMC-5139

Klara
  • 2,935
  • 22
  • 19
  • 2
    the bug still has on java version "1.8.0_162" – pinkdawn May 08 '18 at 08:55
  • 1
    @klara this is even not working in JDK 8u152 as well. – Hakuna Matata May 14 '18 at 08:29
  • This issue started in JDK 8u152, I'm not aware of any work to fix this for coming JDK 8 update releases. – Klara May 14 '18 at 15:02
  • The bug still here on 1.8.0_171 – Denis Bazhenov Jul 02 '18 at 00:28
  • Do you know which versions of SWT are affected by this bug? We face a similar issue in a local application, indeed using an "old version" of SWT, but can't find a corresponding issue on SWT's bug tracker... – James Aug 07 '18 at 16:04
  • Ok, forget it, I've found the answer by myself. Eclipse MAT is getting the same issue with SWT 3.104. The latest release of Eclipse (photon, released in June 2018) bundles with SWT 3.107, and doesn't have the issue. Some people from the MAT community has demonstrated that the issue can be resolved simply by replacing SWT with a newer version: https://www.eclipse.org/forums/index.php/t/1090889/ – James Aug 07 '18 at 16:44
  • plus 1 on the information, minus 1 on the workaround path. – Roy Truelove Feb 20 '19 at 22:42
  • Awful - what kind of testing do you guys do? – Amir Afghani Sep 28 '19 at 18:18
6

I had the same issue and if you don't mind using eclipse, you can install this plugin: https://marketplace.eclipse.org/content/java-mission-control.

But as Klara's accepted answer I eventually managed to run Java Mission Control (not the very newest version though but it still unblock me without big workarround):

  1. Download an older JDK version (I took the Java SE Development Kit 8u91)
  2. I placed it in my /Library/Java/JavaVirtualMachines repository. I did not change my environment variables as I want to keep using a newer version.
  3. I launched the app placed in jdk1.8.0_91.jdk/Contents/Home/lib/missioncontrol/Java Mission Control.app
Antoine Martin
  • 1,903
  • 2
  • 16
  • 28
1

This is a known issue according to the official website. And they don't seem to be doing anything about it since Jan 2018.

https://www.oracle.com/technetwork/java/javase/jmc55-release-notes-2412446.html#known-iss

That mentions three solutions but I followed @Rasika Perera answer to fix this issue on JDK 1.8.0_202

Or you can download this latest version of JDK Mission Control which works on MacOS https://www.oracle.com/java/technologies/javase/products-jmc7-downloads.html

abbas
  • 6,453
  • 2
  • 40
  • 36