问题可能与 这个问题,但那里提供的解决方案在过去 8 年中变得不适用.
The problem is probably the same as in this question, but the solution offered there has become inapplicable in the last 8 years.
我有一个 Eclipse RCP 项目,该项目正在转换为使用 Tycho(2.3.0 版).该项目可以与 Eclipse 2019-06 和为此项目构建的自定义目标平台一起运行.
I have an Eclipse RCP project which is in the process of being transformed to use Tycho (version 2.3.0) instead. The project can be run with Eclipse 2019-06 and the custom target platform built for this project.
然后我用相同的目标平台(一个单独的 Maven 模块引用 Eclipse 使用的相同 *.target 文件)设置 Tycho.
Then I have set up Tycho with the same target platform (a separate Maven module referencing the same *.target file used by Eclipse).
但是当我使用通常的全新安装"运行 Maven(版本 3.6.3)时目标,我收到此错误消息:
But then when I run Maven (version 3.6.3) with the usual "clean install" goals, I get this error message:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.3.0:compile (default-compile) on project my.project.module: Compilation failure: Compilation failure: [ERROR] C:\path\to\a\source\file\in\a\module.java: [ERROR] /* [ERROR] ^ [ERROR] The type org.eclipse.swt.widgets.Event cannot be resolved. It is indirectly referenced from required .class files目标平台为 Eclipse 和 Tycho 以及两个 SWT .jar 文件(org.eclipse.swt_3.111.0.v20190605-1801.jar 和 org.eclipse.swt.win32.win32.x86_64_3.111.0.v20190605-1801.jar) 位于构成目标平台的目录之一中.
The target platform specifies the same environment (win32.win32.x86_64) for both Eclipse and Tycho, and both SWT .jar files (org.eclipse.swt_3.111.0.v20190605-1801.jar and org.eclipse.swt.win32.win32.x86_64_3.111.0.v20190605-1801.jar) are in one of the directories making up the target platform.
推荐答案添加后
jars.extra.classpath = platform:/plugin/org.eclipse.swt.win32.win32.x86_64
到 build.properties 文件(按照推荐的 这里)问题就解决了.
to the build.properties file (as recommended here) the problem is gone.
更多推荐
Tycho 无法解析间接引用的 SWT 依赖项
发布评论