tags:

views:

66

answers:

2

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?

A: 

I have written an tutorial on how to build a standalone eclipse server product containing Restlet services. While it also covers some other topics, it should pretty much walk you through the process of building an standalone product package from eclipse. You can find it here

Edit: The packaging section should be what you are looking for.

wwerner
But that's for just Eclipse applications, right?
Hectoret
Right, might not be what you were looking for.
wwerner
+1  A: 

You can start the OSGi framework from the command line as follows. First for Equinox:

java -jar org.eclipse.osgi_VERSION.jar -console

NB. substitute VERSION for the version of Equinox you have installed. For Felix:

java -jar bin/felix.jar

Now using the OSGi console, install your own bundle:

osgi> install file:/path/to/my/bundle.jar
Bundle ID is 2

And start it:

osgi> start 2
Neil Bartlett