java - headless eclipse 的 config.ini 设置

标签 java eclipse plugins headless

来自this post ,当我尝试执行 headless (headless) Eclipse 代码时出现此错误消息。

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)

我用谷歌搜索找到了这个问题的答案: "Unable to acquire application service" error while launching Eclipse

但是,我不太确定如何放置 config.ini 以及如何放置正确的内容以删除错误消息。

这是我的目录结构,在 eclipse.ini 文件中有 Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@

enter image description here

如何设置 eclipse.ini 文件以及该文件应位于何处?

jar 文件位于 plugins 目录中,runme.sh 有以下脚本:

R2_HOME=.
LIBS=plugins
JARS=.:\
$LIBS/org.eclipse.core.contenttype_3.4.100.v20110423-0524.jar:\
$LIBS/org.eclipse.core.jobs_3.5.100.v20110404.jar:\
$LIBS/org.eclipse.core.runtime_3.7.0.v20110110.jar:\
$LIBS/org.eclipse.core.runtime.compatibility.auth_3.2.200.v20110110.jar:\
$LIBS/org.eclipse.equinox.common_3.6.0.v20110523.jar:\
$LIBS/org.eclipse.equinox.app_1.3.100.v20110321.jar:\
$LIBS/org.eclipse.equinox.launcher_1.2.0.v20110502.jar:\
$LIBS/org.eclipse.equinox.preferences_3.4.1.R37x_v20110725.jar:\
$LIBS/org.eclipse.core.variables_3.2.500.v20110928-1503.jar:\
$LIBS/org.eclipse.osgi.services_3.3.0.v20110513.jar:\
$LIBS/org.eclipse.osgi.util_3.2.200.v20110110:\
$LIBS/org.eclipse.osgi_3.7.2.v20120110-1415

java -cp $JARS org.eclipse.core.launcher.Main -application headlessHello2_1.0.0.201210101509.jar

添加

根据Paul的回答,我将config.ini文件复制到插件导出的目录中。

enter image description here enter image description here

我还修改了脚本,使 -application 指向正确的 ID。

R2_HOME=.
LIBS=plugins
JARS=.:\
$LIBS/org.eclipse.core.contenttype_3.4.100.v20110423-0524.jar:\
...
$LIBS/org.eclipse.osgi_3.7.2.v20120110-1415:\
headlessHello2_1.0.0.201210101509.jar

java -cp $JARS org.eclipse.core.launcher.Main -application headlessHello2.id2

运行此脚本会在 configuration 目录中提供更多文件,但我仍然收到另一条错误消息。

enter image description here

org.osgi.framework.BundleException: The activator headlesshello2.Activator for bundle headlessHello2 is invalid
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:171)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)

可能出了什么问题?

最佳答案

导出产品(甚至基于插件的产品)可以更好地提供运行 RCP 应用程序所需的内容。

但是,如果您已经为 headless (headless)应用程序创建了启动配置,则可以通过查看 <workspace>/.metadata/.plugins/org.eclipse.pde.core/<launch-config.name> 准确找到您需要的 bundle 以及 config.ini 文件的外观。 。 PDE 应该生成一个 config.ini 来启动您的 headless (headless)应用程序。

我仍然建议为您的应用程序创建一个 .product 文件并将其导出,除非您有理由不这样做。

关于java - headless eclipse 的 config.ini 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12829028/

相关文章:

java - 是否有数据结构可以执行以下操作:

Java标签语句和goto

java - 属性未传递给 bean

eclipse - Apache tomcat 7 本地主机页面没有错误,但是运行项目 : show HTTP Status 404 时

java - 在 Eclipse 中安装 Maven,无需插件

java - 如何使用 dart-maven-plugin 构建 dart 项目?

java - 通过 Java 程序使用选择器从 cloudant DB 获取数据时出现异常

java - 创建新 Activity 错误: RED SQUIGGLYS EVERYWHERE

java - 在 MVC 中 servlet 和 JSP 之间存储 session 变量(错误状态 500)

jquery - 如何在悬停而不是点击事件时打开 BeRocket 过滤器,WordPress?