简体   繁体   English

config.ini设置以实现无头蚀

[英]config.ini setup for headless eclipse

From this post , I have this error message when I tried to execute headless eclipse code. 这篇文章中 ,当我尝试执行无头蚀代码时,我收到此错误消息。

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)

I googled to find this as an answer to issue: "Unable to acquire application service" error while launching Eclipse 我用Google搜索找到了它作为问题的答案: 启动Eclipse时出现“无法获取应用程序服务”错误

However, I'm not exactly sure how to put the config.ini and how to put the correct content to remove the error message. 但是,我不确定如何放置config.ini以及如何放置正确的内容以删除错误消息。

This is my directory structure, and I have Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@ inside the eclipse.ini file. 这是我的目录结构,在eclipse.ini中有Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@文件。

在此处输入图片说明

How do I setup the eclipse.ini file, and where the file should be located? 如何设置eclipse.ini文件以及该文件的位置?

The jar files are in plugins directory, and runme.sh has this script: 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 添加

Based on Paul's answer, I copied the config.ini file to the directory where the plugin is exported. 根据Paul的回答,我将config.ini文件复制到了导出插件的目录中。

在此处输入图片说明在此处输入图片说明

I also modified the script to make the -application points to the correct id. 我还修改了脚本,使-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

Running this script gives me some more files in configuration directory, but I still have another error message. 运行此脚本可以为我提供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)

What might be wrong? 可能是什么问题?

Exporting a product (even a plugin-based product) works much better for providing what you need to get a running RCP application. 导出产品(甚至是基于插件的产品)对于提供获得运行的RCP应用程序所需的功能而言,效果更好。

But if you've already created a launch config for your headless app, you can find out exactly what bundles you need and potentially what an config.ini file looks like by looking in <workspace>/.metadata/.plugins/org.eclipse.pde.core/<launch-config.name> . 但是,如果您已经为无头应用程序创建了启动配置,则可以通过在<workspace>/.metadata/.plugins/org.eclipse.pde.core/<launch-config.name>查找来确切找到所需的捆绑包以及config.ini文件的外观<workspace>/.metadata/.plugins/org.eclipse.pde.core/<launch-config.name> There should be a config.ini that PDE generated to launch your headless app. PDE应生成一个config.ini来启动您的无头应用程序。

I'd still recommend creating a .product file for your application and exporting that, unless you have a reason not to. 我仍然建议为您的应用程序创建一个.product文件并将其导出,除非您有理由不这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Eclipse RCP产品中的自定义config.ini - Custom config.ini in Eclipse RCP product 为Eclipse RCP项目生成默认的config.ini - Generating default config.ini for an Eclipse RCP projekt 在config.ini中设置默认透视图(Eclipse IDE) - Setting default perspective in config.ini (Eclipse IDE) 生成了Equinox config.ini - Equinox config.ini generated rcp国际化,使用config.ini更改语言 - rcp internationalization, change language, with config.ini 无法获得应用程序服务。 确保解析并启动了org.eclipse.core.runtime包(请参阅config.ini) - Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini) 如何在Runnable Jar中设置config.ini文件的路径? - How to set path of a config.ini file in a Runnable Jar? RCP产品:将@start添加到config.ini文件中的捆绑包 - RCP Product: add @start to a bundle in config.ini file 如何在Linux中使用-vm参数在eclispe RCP产品的Config.ini文件中设置类路径 - How to set class path in Config.ini file of a eclispe RCP product using -vm argument in linux config.ini文件属性被OSGI运行时中的另一个文件属性替换 - config.ini file properties being replaced by another file properties in OSGI Run Time
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM