在Windows软件包中使用
org.eclipse.swt.win32.win32.x86_64
,而在Linux构建中使用org.eclipse.swt.gtk.linux.x86_64
。
If nothing is specified in
module-info.java
, error message isjava: package org.eclipse.swt does not exist
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
If only one
requires
is specified, then project works only on one platform.
为了使项目能够在两个平台上运行,module-info.java
的设置应该是什么样的?
module-info.java
时就会出现问题。 - iljaurequires swt;
,不确定它是否真正解决了跨平台的问题。 - greg-449requires swt
来自于下载的 zip 文件中的swt.jar
。由于我正在使用从 Maven 构建的 SWT,因此我的模块名称如问题所述。我的问题是如何在module-info.java
中指定requires
,以便适用于 Linux 和 Windows 构建。 - iljau