Eclipse RCP 插件错误 - 无法解析模块

Eclipse RCP plugin error - Cannot resolve module

当我尝试 运行 像这样的 eclipse 产品时:

我收到大约 100 个错误类型 "Could not resolve module XXXX"。例如,部分日志视图:

!ENTRY org.eclipse.compare 4 0 2017-07-14 11:03:53.679
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.compare [18]
  Unresolved requirement: Require-Bundle: org.eclipse.ui.views; bundle-version="[3.2.0,4.0.0)"
    -> Bundle-SymbolicName: org.eclipse.ui.views; bundle-version="3.8.100.v20160518-1929"; singleton:="true"
       org.eclipse.ui.views [107]
         Unresolved requirement: Require-Bundle: org.eclipse.ui; bundle-version="[3.5.0,4.0.0)"
           -> Bundle-SymbolicName: org.eclipse.ui; bundle-version="3.108.0.v20160518-1929"; singleton:="true"
              org.eclipse.ui [99]
                Unresolved requirement: Require-Bundle: org.eclipse.ui.workbench; bundle-version="[3.105.0,4.0.0)"; visibility:="reexport"
                  -> Bundle-SymbolicName: org.eclipse.ui.workbench; bundle-version="3.108.0.v20160602-1232"; singleton:="true"
                     org.eclipse.ui.workbench [109]
                       Unresolved requirement: Import-Package: org.eclipse.e4.ui.internal.workbench.swt
                         -> Export-Package: org.eclipse.e4.ui.internal.workbench.swt; bundle-symbolic-name="org.eclipse.e4.ui.workbench.swt"; bundle-version="0.14.0.v20160523-1900"; version="0.0.0"; x-friends:="org.eclipse.e4.ui.workbench.addons.swt,org.eclipse.e4.ui.workbench.renderers.swt,org.eclipse.ui.workbench"
                            org.eclipse.e4.ui.workbench.swt [52]
                              Unresolved requirement: Require-Bundle: org.eclipse.equinox.event; resolution:="optional"
                              Unresolved requirement: Require-Capability: osgi.extender; filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"
                       Unresolved requirement: Import-Package: org.eclipse.e4.ui.internal.workbench.renderers.swt
                         -> Export-Package: org.eclipse.e4.ui.internal.workbench.renderers.swt; bundle-symbolic-name="org.eclipse.e4.ui.workbench.renderers.swt"; bundle-version="0.14.0.v20160525-0940"; version="0.0.0"; x-friends:="org.eclipse.ui.workbench"
                            org.eclipse.e4.ui.workbench.renderers.swt [51]
                              Unresolved requirement: Require-Bundle: org.eclipse.e4.ui.workbench.swt; bundle-version="0.9.0"
                                -> Bundle-SymbolicName: org.eclipse.e4.ui.workbench.swt; bundle-version="0.14.0.v20160523-1900"; singleton:="true"
  Unresolved requirement: Require-Bundle: org.eclipse.ui.workbench.texteditor; bundle-version="[3.5.0,4.0.0)"
    -> Bundle-SymbolicName: org.eclipse.ui.workbench.texteditor; bundle-version="3.10.0.v20160530-2011"; singleton:="true"
       org.eclipse.ui.workbench.texteditor [110]
         Unresolved requirement: Require-Bundle: org.eclipse.ui; bundle-version="[3.5.0,4.0.0)"
           -> Bundle-SymbolicName: org.eclipse.ui; bundle-version="3.108.0.v20160518-1929"; singleton:="true"
  Unresolved requirement: Require-Bundle: org.eclipse.ui.editors; bundle-version="[3.5.0,4.0.0)"
    -> Bundle-SymbolicName: org.eclipse.ui.editors; bundle-version="3.10.0.v20160505-0931"; singleton:="true"
       org.eclipse.ui.editors [101]
         Unresolved requirement: Require-Bundle: org.eclipse.ui.ide; bundle-version="[3.5.0,4.0.0)"
           -> Bundle-SymbolicName: org.eclipse.ui.ide; bundle-version="3.12.0.v20160601-1609"; singleton:="true"
              org.eclipse.ui.ide [103]
                Unresolved requirement: Require-Bundle: org.eclipse.ui; bundle-version="[3.106.0,4.0.0)"
                  -> Bundle-SymbolicName: org.eclipse.ui; bundle-version="3.108.0.v20160518-1929"; singleton:="true"
                Unresolved requirement: Require-Bundle: org.eclipse.ui.workbench; bundle-version="[3.7.0,4.0.0)"
                  -> Bundle-SymbolicName: org.eclipse.ui.workbench; bundle-version="3.108.0.v20160602-1232"; singleton:="true"
  Unresolved requirement: Require-Bundle: org.eclipse.ui; bundle-version="[3.5.0,4.0.0)"
    -> Bundle-SymbolicName: org.eclipse.ui; bundle-version="3.108.0.v20160518-1929"; singleton:="true"
  Unresolved requirement: Require-Bundle: org.eclipse.ui.ide; bundle-version="[3.3.0,4.0.0)"
    -> Bundle-SymbolicName: org.eclipse.ui.ide; bundle-version="3.12.0.v20160601-1609"; singleton:="true"

    at org.eclipse.osgi.container.Module.start(Module.java:444)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1599)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

我认为是因为插件无法检测到所需的依赖项。 我尝试在

中添加这些依赖项

Run Configurations > Plug-ins Tab > Add Required Plug-ins

像许多用户一样post,但它不能正常工作。我的意思是,添加了新的依赖项,但错误并没有消失。

我也试过下载库 .jar 文件并将它们包含到项目中,但它也无法正常工作。

你能帮帮我吗?

我的目标是为 运行 Eclipse RCP 插件生成二进制文件或可执行文件。

谢谢! ;)

也许可以尝试添加 org.eclipse.equinox.ds 作为依赖项。更多信息 here

如果您在使用“.target”文件作为目标平台时遇到同样的问题,您可以指定插件org.eclipse.equinox.ds 在“隐式插件依赖项”部分的“环境” ”选项卡。