簡體   English   中英

config.ini設置以實現無頭蝕

[英]config.ini setup for 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)

我用Google搜索找到了它作為問題的答案: 啟動Eclipse時出現“無法獲取應用程序服務”錯誤

但是,我不確定如何放置config.ini以及如何放置正確的內容以刪除錯誤消息。

這是我的目錄結構,在eclipse.ini中有Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.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

添加

根據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)

可能是什么問題?

導出產品(甚至是基於插件的產品)對於提供獲得運行的RCP應用程序所需的功能而言,效果更好。

但是,如果您已經為無頭應用程序創建了啟動配置,則可以通過在<workspace>/.metadata/.plugins/org.eclipse.pde.core/<launch-config.name>查找來確切找到所需的捆綁包以及config.ini文件的外觀<workspace>/.metadata/.plugins/org.eclipse.pde.core/<launch-config.name> PDE應生成一個config.ini來啟動您的無頭應用程序。

我仍然建議為您的應用程序創建一個.product文件並將其導出,除非您有理由不這樣做。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM