Launch plugin as OSGi
I changed my Java SE (right button click on project Configure -> Convert to Plug-in Projects) to plu开发者_开发问答g -in, but when i try to run it - it run as Eclipse application, how to start it as OSGi? Thanks!
Converting a JavaSE application into a single, big bundle basically means that you're launching your code in a different way. Instead of the public static void main(String[] args) you now implement the BundleActivator interface which has a start() and a stop() method (each with a BundleContext as argument).
Launching that depends a bit on what framework implementation you chose. Since OSGi 4.2 there is a launcher API (paragraph 6.2 of the spec) which specifies a universal mechanism to launch a framework and run your single bundle. If you use an older implementation, launching is framework specific and I can only refer you to the documentation of that framework.
精彩评论