从命令行运行osgi bundle [英] Run osgi bundle from command line
问题描述
我开发了OSGi软件包,通常通过Eclipse对其进行测试.在导出捆绑包之后,我得到了bundle.jar文件.我希望能够从命令行运行生成的文件.像这样:
I developed an OSGi bundle, which I usually test from Eclipse. Aftrer exporting the bundle, I get a bundle.jar file. I would like to be able to run the generated file from the command line. Something like:
C:\ java -jar bundle.jar osgi_framework路径
C:\java -jar bundle.jar osgi_framework path
但是,如何在其中包含osgi框架?而且,如何立即启动捆绑包?
But, how to include the osgi framework in it? and also, how can I start the bundle immediately?
推荐答案
您可以从命令行启动OSGi框架,如下所示.首先是Equinox:
You can start the OSGi framework from the command line as follows. First for Equinox:
java -jar org.eclipse.osgi_VERSION.jar -console
NB.用VERSION代替您安装的Equinox版本.对于Felix:
NB. substitute VERSION for the version of Equinox you have installed. For Felix:
java -jar bin/felix.jar
现在使用OSGi控制台,安装您自己的捆绑软件:
Now using the OSGi console, install your own bundle:
osgi> install file:/path/to/my/bundle.jar
Bundle ID is 2
并启动它:
osgi> start 2
这篇关于从命令行运行osgi bundle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!