Eclipse now runs on Wayland

Still needs more work.

As the end of GSoC 2014 approaches, I can now say that Eclipse successfully starts in Weston. Some things look a little bit strange and I’m sure there are more bugs to work out, but for now the majority of Eclipse seems to run properly in a Wayland environment.

Dialog windows appear

What This Required:

The SWT toolkit mostly uses the GDK/GTK and Cairo frameworks to implement its standardized functionality on a Linux platform. But, in some cases it made more sense during the development of SWT to access the X11 API directly. In other cases SWT would make use of X11 dependent functions from the Cairo and GDK APIs.

Each one of these function calls had to be replaced with a Wayland compatible alternative. In most cases the GDK API recently added suitable alternatives to the X11 functions around the release of GTK3. However, as of writing this, some things like Clipboard support are still a work-in-progress on the GDK side.

To Test:

First, you will need two things:

  1. A recent set of libswt-*.so library files from the linux.x86_64 section of the eclipse.platform.swt.binaries repository.
  2. A recent build of Eclipse. Testing should be done with a fresh copy and not your production version.

When eclipse has finished downloading:

  1. Run Eclipse for the first time, this creates a folder structure in the eclipse/configuration directory
  2. Then copy the .so files to the folder containing the libswt*.so files used by Eclipse. For me this was at: eclipse/configuration/org.eclipse.osgi/197/0/.cp

The Eclipse Native Launcher also contains X11 functions, but since it is not part of the SWT project it was not included in this port.

Therefore to test Eclipse in Wayland you need to launch the runnable jar directly. I also had to specify the workspace location on the command line since opening the workspace selection window causes a busy wait condition.

The commands I used were:

mkdir ~/workspace_testing

GDK_BACKEND=wayland java -jar plugins/*.equinox.launcher_*.jar -data ~/workspace_testing

After that, eclipse should open up in Weston. If the JVM crashes on start up with a message about native code, then it is likely still finding old copies of the libswt-*.so libraries somewhere.

Next Steps:

Now that eclipse can run without crashing in Weston, work can begin on improving the experience until it matches that given by the X11 based code.

This should be a relatively easy process now that Eclipse’s debugging tools can be run under Wayland.

Edit: A big thank you to Michael Larabel of for writing about my work.

Debug perspective working

About Joshua Barkovic

I am a fourth year Software Engineering student at McMaster University, Hamilton Ontario, Canada.
This entry was posted in Other. Bookmark the permalink.

One Response to Eclipse now runs on Wayland

Comments are closed.