Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I've recently had one of the DBAs on a project ask me what GTK version is required to run Java Mission Control with JDK 7. I thought easy, the documentation should tell me this, but after searching for several hours I've come up with nothing, apart from 'GTK Libraries Required' as stated in the Oracle Java Mission Control 5.3 Certified System Configurations.

Interestingly the Oracle JDK 7 and JRE 7 Certified System Configurations doesn't mention GTK at all, however the Oracle JDK 8 and JRE 8 Certified System Configurations does. In fact the JDK 8 matrix goes on to say 'For Linux platforms, gtk2 2.18+ is required for supporting JavaFX.', however we aren't interested in JavaFX or JDK 8 here.

Since I couldn't get answers in the documentation the only solution was to do it the hard way and see what the binaries actually depend on. Here come the linking errors...

When running jmc, the output is something like this...
 Terminal
$ jmc
Jmc:
An error has occurred. See the log file
/home/user/.jmc/5.5.0/.metadata/.log.


That is not too helpful but the log reveals more...
jmcgtkerr.png

 JMC Error Log
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
/jdk1.7.0_85/lib/missioncontrol/configuration/org.eclipse.osgi/322/0/.cp/libswt-pi-gtk-4430.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
no swt-pi-gtk in java.library.path
Can't load library: /home/user/.swt/lib/linux/x86_64/libswt-pi-gtk-4430.so
Can't load library: /home/user/.swt/lib/linux/x86_64/libswt-pi-gtk.so
/home/user/.swt/lib/linux/x86_64/libswt-pi-gtk-4430.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:327)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:236)




Now I was starting to get somewhere! What was missing was the libgtk-x11-2.0.so.0 file. Doing a search on rpmfind.net reveals this library is present in as far back as version 2.0 of GTK.

So to be on the safe side I would say the latest GTK 2 library should be installed and at the minimum the 2.18 version should be picked to future proof any JDK upgrades.

-i

A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.