Creating an OSGi bundle from a JAR file
About this task
Creating an OSGi bundle from a JAR file in the file system
Procedure
- Access the Import wizard. Click .
- Choose Next. . Click
- Choose the JAR file. In the wizard, for JAR file, click Browse then browse to the location on your hard disk for the JAR file that you want to import.
- Choose a bundle or create a new bundle to add the JAR file to. In the wizard, if you have an existing bundle in your workspace that you want to add the JAR file to, select the bundle from the drop-down menu. If you want to create a bundle for the JAR file, click New Bundle. If you are creating a new bundle, follow the steps of the wizard. When done, click Finish to return to the import wizard. The JAR file and Bundle fields are now populated.
- Click Next to proceed to the packages screen of the wizard.
- From the Packages list, select the packages in the JAR file that you want to be added to the Export-Package header in the bundle MANIFEST.MF file.
- Click Finish. A bundle is now created based on the JAR file, and export entries for selected packages in the JAR file are added to the Export-Package header of the bundle.
Creating an OSGi bundle from a JAR file in a workspace project
Procedure
- Access the Copy or Move into OSGi bundle wizard. Right-click a JAR file in a project in your workspace and select or select If the JAR file is in an OSGi bundle project, you are presented with the Move into OSGi bundle wizard to help avoid the possibility of the JAR file being present in two different bundle projects. For other project types, you are presented with the Copy into OSGi bundle wizard.
- Choose a bundle or create a new bundle to add the JAR file to. In the wizard, if you have an existing bundle in your workspace that you want to add the JAR file to, select the bundle from the drop-down menu. If you want to create a bundle for the JAR file, click New Bundle. If you are creating a new bundle, follow the steps of the wizard. When done, click Finish to return to the import wizard. The JAR file and Bundle fields are now populated.
- Click Next to proceed to the packages screen of the wizard.
- From the Packages list, select the packages in the JAR file that you want to be added to the Export-Package header in the bundle MANIFEST.MF file.
- Click Finish. A bundle is now created based on the JAR file, and export entries for selected packages in the JAR file are added to the Export-Package header of the bundle.