module-info.java for SWT cross-platform maven project

Viewed 187

On Windows package org.eclipse.swt.win32.win32.x86_64 is used, while for Linux build it's org.eclipse.swt.gtk.linux.x86_64.

  1. If nothing is specified in module-info.java, error message is java: package org.eclipse.swt does not exist

  2. If in module-info.java both are specified:

    requires org.eclipse.swt.gtk.linux.x86_64;
    requires org.eclipse.swt.win32.win32.x86_64;
    

    error message: module ... reads package org.eclipse.swt from both org.eclipse.swt.gtk.linux.x86_64 and org.eclipse.swt.win32.win32.x86_64

  3. If only one requires is specified, then project works only on one platform.

What would be correct setup for module-info.java, so that project would run on both platforms?

1 Answers

It's a bug 559162 in SWT. Their Automatic-Module-Name in the SWT jar files manifest is impractical.

I suggest to stick to module-less builds (without module-info.java) until this gets fixed.

Related