Skip to main content

Eclipse SWT_AWT bridge broken on Mac OS X with openjdk 7u4ea

Please note these forums are being decommissioned and use the new and improved forums at
2 replies [Last post]
Joined: 2012-03-14

OS: Mac OS X 10.7.3

JVM: openjdk 7u4 build b 15

Eclipse 3.7.1 (but actually it affects all versions from 3.6 till 3.7.2)

The root cause is

org.eclipse.swt.SWTError: Not implemented (java.lang.ClassNotFoundException: apple.awt.CEmbeddedFrame)

at org.eclipse.swt.SWT.error(

at org.eclipse.swt.SWT.error(

Fortunately the SWT guys were forward thinking enough to provide an override mechanism for the classname so this would normally allow plugin vendors to patch arround the problem with an update to the new classes located in sun.lwawt.macosx.CEmbeddedFrame.

But alas that also fails since the two classes differ in method signatures for the constructor.

SWT_AWT.embeddedFrameClass = "sun.lwawt.macosx.CEmbeddedFrame";

fFrame = SWT_AWT.new_Frame(fMainComposite);

java.lang.NoSuchMethodException: sun.lwawt.macosx.CEmbeddedFrame.<init>(long)

Since the new class has more methods there may of course be other compatibility problems.

This affects among others the tools from my company and most likely the GUI designers from Instantiations, the Google GWT plugins, .. and a suprising number of people mixing SWT with Swing or AWT. Obviously the problem is that SWT is using a non api class and updating SWT would solve this but that is not feasible for all software out in the field. I'm not sure what the release plans are for 1.7.0_04 on Mac but if Apple is planning on pushing it via Apple Update you can bet this is going to affect a whole lot of people out there. Eclipse releases take a long time, most plugins can't ship with an updated SWT plugin as they don't have control over this and there are many large organisations (usually financial institutions) that dictate a specific eclipse version as company standard. That is of course a shame as it would hinder java 7 adoption on Mac to some extend.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-08-08

This is a known problem: current sun.lwawt.macosx.CEmbeddedFrame is CALayer-based, which is not appropriate for embedding into SWT, which expects NSView-based implementation. The following bug is filed against JDK7 AWT: 7154778, it will be visible at in a few days.

Joined: 2012-03-14

Linked with Eclipse issue 374199