config.ini设置为无头日食 [英] config.ini setup for headless eclipse

查看:149
本文介绍了config.ini设置为无头日食的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这篇文章,当我尝试执行无头eclipse代码。

  java.lang.RuntimeException:在org.eclipse.equinox.launcher.Main.getBootPath中找不到框架
(Main.java:978)
在org.eclipse.equinox.launcher.Main.basicRun(Main.java:557)
在org.eclipse.equinox.launcher.Main.run(Main.java :1410)
在org.eclipse.equinox.launcher.Main.main(Main.java:1386)

我googled找到这个答案发布:
无法获取应用程序服务启动Eclipse时出错



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



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





如何设置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文件复制到导出插件的目录。




< img src =https://i.stack.imgur.com/xnefk.pngalt =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应用程序headlessHello2.id2

运行此脚本会给我一些更多的文件,配置目录,但我仍然有另一个错误消息。



  org.osgi.framework.BundleException:激活头headlesshello2.Andivator for bundle headlessHello2在org.eclipse.osgi.framework上无效
。 internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:171)
在org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
在org.eclipse。 osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
在org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
<

解决方案

导出产品(甚至是基于插件的产品)可以更好地提供您需要获得正在运行的RCP应用程序。



但如果您有已经为您的无头应用程序创建了启动配置,您可以找到ex通过查看< workspace> /。metadata / .plugins / org.eclipse.pde.core /< launch-config.name> ;,您需要什么软件包和潜在的config.ini文件。 ; 。应该有一个PDE生成的config.ini来启动你的无头应用程序。



我仍然建议为应用程序创建一个.product文件,并导出,除非你有理由不去。


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

However, I'm not exactly sure how to put the config.ini and how to put the correct content to remove the error message.

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.

How do I setup the eclipse.ini file, and where the file should be located?

The jar files are in plugins directory, and runme.sh has this script:

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.

I also modified the script to make the -application points to the correct 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.

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.

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>. There should be a config.ini that PDE generated to launch your headless app.

I'd still recommend creating a .product file for your application and exporting that, unless you have a reason not to.

这篇关于config.ini设置为无头日食的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆