Osgi導出的產品不能獨立啓動的問題之一的解決

現象:用eclipse的導出工具,生成一個產品目錄,點擊裏面的執行文件,報錯: java


The xx executable launcher was unable to locate its companion shared library
國內網上搜了一下,都是eclipse本身啓動時報這個錯,基本上的解決方案以下:


修改Myeclipse.ini文件
shell

-startup
../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
../Common/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-install
D:/Program Files/Genuitec/MyEclipse-8.6
-vm
D:/ProgramFiles/Genuitec/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/bin/client/jvm.dll
-configuration
configuration
-vmargs
-Xmx512m
-XX:MaxPermSize=256m
-XX:ReservedCodeCacheSize=64m

不能解決獨立osgi產品的運行問題,可是eclipse也是osgi框架,對比ini後發現,產品ini裏沒有「startup」的描述,判斷是自動產生的配置裏缺乏一起,最後在一個老外的網頁上看到一些解釋,網址以下: app

http://devblog.virtage.com/2012/09/equinox-launcher-error-the-xy-executable-launcher-was-unable-to-locate-its-companion-shared-library/ 框架

轉帖文字以下: eclipse


Sometimes in your Eclipse RCP/Equinox based development you may encounter this error. In this short tip I will explain the reason of this error and it can be fixed. jvm

equinox-launcher-unable-to-locate-its-companion-shared-library.png

Replace name of 「plexflow-server」 with 「your-app」. ide

Small recap

Launcher is platform-specific part of Eclipse Equinox that eases launching OSGi Framework and provides more native feeling from starting Eclipse RCP or OSGi based applications to the end users. 工具

Launching in native way is composed of three parts: native exacutable itself, platform specific library and Java launcher JAR. post

You can read more about Equinox launcher in my previous post. ui

Why?

Native launcher cannot locate shared library. It is missing inplugins/folder or is not in folder (exploded) form so native launcher cannot load load it.

Make sure that your build app has this layout:

+ your-app/ 
+--- your-app.exe
+--+ plugins/
   +---- prg.eclipse.equinox.launcher_<os>.<ws>.<arch>_<version>/
       +--- eclipse_1502.so (Linux) OR
       +--- eclipse_1503.dll (Win) OR
       +--- eclipse_1503.so (Mac)
==========最終解決方案=======

把eclipse的plugins目錄下的

org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130807-1835目錄

和org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar包

copy到產品plugins目錄下,

在產品ini文件中添加-startup這段配置,

再次執行啓動腳本,成功經過。

相關文章
相關標籤/搜索