Search code examples
javaubuntueclipse-plugin

SWTError: Not implemented [multiple displays] in Eclipse plug-in devlopment


I have plug-in project in which I am using

Display display = new Display(); // twice 

this plug-in is working fine on Windows.

But when I run plug-in on Linux it throws an error:

org.eclipse.swt.SWTError: Not implemented [multiple displays]
Root exception:
    org.eclipse.swt.SWTError: Not implemented [multiple displays]
    at org.eclipse.swt.SWT.error(SWT.java:4423)
    at org.eclipse.swt.widgets.Display.checkDisplay(Display.java:767)
    at org.eclipse.swt.widgets.Display.create(Display.java:908)
    at org.eclipse.swt.graphics.Device.<init>(Device.java:156)
    at org.eclipse.swt.widgets.Display.<init>(Display.java:507)
    at org.eclipse.swt.widgets.Display.<init>(Display.java:498)
    at com.test$OpenPage.run(test.java:267)
    at org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage$29.run(AbstractRepositorySettingsPage.java:1964)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

I have tested it on Windows 7/8.1/10 (working fine) and Ubuntu (not working)


Solution

  • Support for multiple Display objects varies between platforms. Looking at the source code this is not supported on Linux/GTK or macOS.

    For full portability you need to stick to a single Display device. It is generally not necessary to use more than one.