Including a JAR file in an OSGi application
About this task
Procedure
- Create an OSGi bundle from the JAR file. If the JAR file is not already an OSGi bundle, create a bundle that is based on the JAR file. For details on how to create an OSGi bundle, see Creating an OSGi bundle from a JAR file. If you are unsure whether a JAR file is already a bundle, open up the JAR file and ensure that there is a META-INF/MANIFEST.MF file in the JAR file that contains a Bundle-SymbolicName header with the name of the bundle.
- Ensure that the bundle is in the workspace. If you created a bundle from the JAR file, the new bundle is in your workspace. If the JAR file was already a bundle but not in your workspace, import the bundle. To import the bundle, click . Follow the steps of the wizard to import the bundle.
- Add the bundle to your application. Double-click the APPLICATION.MF file in your OSGi application and select the Overview tab. The manifest editor opens. In the Contained Bundles section, click Add. Select the bundle that you want to include in your application. Click OK to add the bundle.