Fw: SWT_AWT bridge fails with IllegalAccessException in Java 1.9

Lakshmi P Shanmugam lshanmug at in.ibm.com
Tue Dec 8 08:13:57 UTC 2015


The Eclipse SWT (Standard Widget Toolkit) project’s SWT_AWT bridge is
broken with the Java 1.9 + Jigsaw builds and fails with
java.lang.IllegalAccessException (details:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=482318). This is caused by
the encapsulation of internal classes that are used by the SWT_AWT bridge.

The SWT_AWT bridge class uses the following internal classes to create an
embedded frame, using the handle provided by SWT.
[1] sun.awt.windows.WEmbeddedFrame on Windows
[2] sun.awt.X11.XEmbeddedFrame on Linux
[3] sun.lwawt.macosx.CViewEmbeddedFrame on MacOSX
These classes are encapsulated in Java 1.9 (according to JEP 260) and are
not accessible now.

I would like to request for the addition of the above internal APIs to the
critical API list in JEP 260 so that are accessible for Java 1.9. Also,
please provide replacement APIs for them in the future.

The SWT_AWT class provides a bridge between SWT and AWT, so that it is
possible to embed AWT components in SWT and vice versa.
With the proposed encapsulation changes the above internal classes used by
SWT_AWT bridge class are not accessible and embedding AWT/Swing in SWT will
not work on any of the platforms (Windows, Linux and Mac OSX). AFAIK, there
are no replacement public APIs to create the EmbeddedFrame using a given

User impact:
This will break all the applications that use the SWT_AWT bridge to embed
AWT/Swing in SWT/Eclipse RCP applications on all the supported platforms
(Windows, Linux and Mac OSX).

Using the command line flag -XaddExports works as a work around, but we are
looking forward for a solution.

Link to source files:
[1] -
[2] -
[3] -

Thanks & Regards,
Lakshmi P Shanmugam

More information about the jigsaw-dev mailing list