From 这个帖子,当我尝试执行无头 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)
我用谷歌搜索找到了这个问题的答案:启动 Eclipse 时出现“无法获取应用程序服务”错误
但是,我不太确定如何放置 config.ini 以及如何放置正确的内容以删除错误消息。
这是我的目录结构,我有Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@
在 eclipse.ini 文件内。
如何设置 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
ADDED
根据Paul的回答,我将config.ini文件复制到插件导出的目录中。
我还修改了脚本以使其-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
目录,但我仍然有另一个错误消息。
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)
可能出了什么问题?