eclipse 导出的产品无法解析 org.eclipse.core.runtime 而 "launch application" 确实有效

eclipse exported product could not resolve org.eclipse.core.runtime while "launch application" does work

开发基于 eclipse 插件的应用程序。在产品中,当我按下 "Launch an Eclipse application" 时,应用程序运行正常。 当我导出应用程序并尝试启动它时,我得到 org.eclipse.core.runtime 未解析。 是的,在依赖关系中我做了一个 "add required plug-ins"。 我应该怎么做才能导出工作产品?

这是当前的开发树: https://github.com/magwas/zenta/tree/export_bugreport 您可以在 org.rulez.magwas.zenta.editor.build/zenta.product 中找到产品文件,在 tmp/Zenta.eclipse

中找到导出的产品

我在启动级别配置中有一个条目: org.eclipse.core.runtime autoStart="true" startLevel="0"

这是启动失败的日志:

!SESSION 2016-01-23 10:17:04.939 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_91
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64

!ENTRY org.eclipse.core.runtime 4 0 2016-01-23 10:17:05.560
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.core.runtime [1]
  Unresolved requirement: Require-Bundle: javax.annotation; bundle-version="1.1.0"; visibility:="reexport"; resolution:="optional"
  Unresolved requirement: Require-Bundle: javax.inject; bundle-version="1.0.0"; visibility:="reexport"; resolution:="optional"
  Unresolved requirement: Require-Bundle: org.eclipse.equinox.common; bundle-version="[3.6.100,4.0.0)"; visibility:="reexport"

        at org.eclipse.osgi.container.Module.start(Module.java:434)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
        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)

!ENTRY org.eclipse.osgi 4 0 2016-01-23 10:17:05.562
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.core.runtime_3.10.0.v20140318-2214.jar was not resolved.

!ENTRY org.eclipse.core.runtime 2 0 2016-01-23 10:17:05.565
!MESSAGE Could not resolve module: org.eclipse.core.runtime [1]
  Unresolved requirement: Require-Bundle: javax.annotation; bundle-version="1.1.0"; visibility:="reexport"; resolution:="optional"
  Unresolved requirement: Require-Bundle: javax.inject; bundle-version="1.0.0"; visibility:="reexport"; resolution:="optional"
  Unresolved requirement: Require-Bundle: org.eclipse.equinox.common; bundle-version="[3.6.100,4.0.0)"; visibility:="reexport"


!ENTRY org.eclipse.osgi 4 0 2016-01-23 10:17:05.566
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:78)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

您在 .product 文件中的启动级别配置似乎有误(在 .product 编辑器的“启动级别”部分的“配置”选项卡上)。

对于简单的 RCP,您不需要指定级别,因此只需清除此项。