从命令行运行 osgi 包
我开发了一个 OSGi 包,我通常在 Eclipse 中测试它。导出捆绑包后,我得到一个bundle.jar 文件。我希望能够从命令行运行生成的文件。类似于:
C:\java -jar bundle.jar osgi_framework 路径
但是,如何在其中包含 osgi 框架呢?另外,我怎样才能立即启动捆绑包?
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 path
But, how to include the osgi framework in it? and also, how can I start the bundle immediately?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以从命令行启动 OSGi 框架,如下所示。首先是春分:
注意。将 VERSION 替换为您安装的 Equinox 版本。对于 Felix:
现在使用 OSGi 控制台,安装您自己的捆绑包:
并启动它:
You can start the OSGi framework from the command line as follows. First for Equinox:
NB. substitute VERSION for the version of Equinox you have installed. For Felix:
Now using the OSGi console, install your own bundle:
And start it:
虽然这是一个非常老的问题,但人们在使用命令
java -jar org.eclipse.osgi.jar -console
运行 osgi 控制台时遇到问题,因为缺少几个所需的包,例如 Neil 答案的注释。请参阅我的答案此处获取有关如何运行osgi的说明安慰。 osgi 控制台启动后,只需按照 Neil 的回答安装您自己的捆绑包即可。
Though it's a really old question but people are having problems running the osgi console with command
java -jar org.eclipse.osgi.jar -console
since the lack of several bundles needed like the comments to Neil's answer.See my answer here to get the instructions on how to run the osgi console. After osgi console starts, just follow Neil's answer to install your own bundles.