在命令行执行无头eclipse

pro*_*eek 7 java eclipse command-line eclipse-plugin headless

按照这个指令,我可以在Eclipse IDE中运行无头Eclipse插件.

在此输入图像描述

我有一些错误日志信息,但我想我可以根据这篇文章忽略它 - 无法在目录中找到feature.xml

在此输入图像描述

按照站点中的说明,我可以生成jar文件.复制org.eclipse.equinox.launcher.jar后,我尝试执行jar文件

java -jar org.eclipse.equinox.launcher_1.2.0.v20110502.jar -application headlessHello_1.0.0.201210101430.jar
Run Code Online (Sandbox Code Playgroud)

我试过了

java -cp .:org.eclipse.equinox.launcher_1.2.0.v20110502.jar org.eclipse.core.launcher.Main -application headlessHello_1.0.0.201210101430.jar
Run Code Online (Sandbox Code Playgroud)

获取错误消息

An error has occurred.  See the log file
/Users/users/Desktop/configuration/1349897444823.log
Run Code Online (Sandbox Code Playgroud)

使用此日志文件

!SESSION Wed Oct 10 14:30:44 CDT 2012 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2012-10-10 14:30:44.843
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.RuntimeException: Could not find framework
    at org.eclipse.equinox.launcher.Main.getBootPath(Main.java:978)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:557)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Run Code Online (Sandbox Code Playgroud)

添加

这个网站,问题是因为我没有%R2_HOME%/plugins正确设置.设置完成后,我仍然收到错误.

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:74)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
    at org.eclipse.core.launcher.Main.main(Main.java:34)
Run Code Online (Sandbox Code Playgroud)

Zag*_*rev 3

Headless Eclipse 的实例需要包含许多插件,而不仅仅是您的插件。最小的产品包括:

  • org.eclipse.core.runtime
  • org.eclipse.core.variables
  • <此处是您的插件>

编辑

我生成了产品,下面是我的“最小”无头 Eclipse 使用的插件列表:

我输出产品,这是加载的插件列表:

org.eclipse.core.contenttype_3.4.100.v20100505-1235.jar
org.eclipse.core.jobs_3.5.1.R36x_v20100824.jar
org.eclipse.core.runtime.compatibility.auth_3.2.200.v20100517.jar
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20100520
org.eclipse.core.runtime_3.6.0.v20100505.jar
org.eclipse.equinox.app_1.3.1.R36x_v20100803.jar
org.eclipse.equinox.common_3.6.0.v20100503.jar
org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.2.R36x_v20101222
org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
org.eclipse.equinox.preferences_3.3.0.v20100503.jar
org.eclipse.equinox.registry_3.5.0.v20100503.jar
org.eclipse.osgi.services_3.2.100.v20100503.jar
org.eclipse.osgi.util_3.2.100.v20100503.jar
org.eclipse.osgi_3.6.2.R36x_v20110210.jar
Run Code Online (Sandbox Code Playgroud)

因此,我是否建议您为正在构建的 Eclipse 应用程序创建一个产品,并尝试一下。在寻找常见问题解答时我发现了这个。http://wiki.eclipse.org/FAQ_What_is_the_minimal_Eclipse_configuration%3F