configuration : Ubuntu 13.04 + Eclipse4.3 + JRE 7
Symptom : Open an Eclipse view with an inline awt/swing code, eclipse directly hangs out
cause : Both awt/swing and SWT use locks to protect their threads when accessing GTK. AWT uses the GTK lock, but SWT uses its own lock. When using SWT to access AWT, an error occurs.
workaround : Use the following code in the code that accesses AWT with SWT:
Uimanager.setlookandfeel (Uimanager.getsystemlookandfeelclassname ());
Modified to:
if (Platform.WS_GTK.equals (Platform.getws ())) {Uimanager.setlookandfeel ("Javax.swing.plaf.metal.MetalLookAndFeel "); } else {Uimanager.setlookandfeel (Uimanager.getsystemlookandfeelclassname ()); }
Reference: HTTPS://GITHUB.COM/NKAVIANI/CA.UBC.MAGIC.PARTITIONING.ANALYZER.PLUGIN.ECLIPSE/ISSUES/3
https://bugs.eclipse.org/bugs/show_bug.cgi?id=341799
This article is from the "winger" blog, make sure to keep this source http://imu2008.blog.51cto.com/3844842/1437307