Importing a binary JAR file into an OSGi plug-in project

You can create a plug-in project from an existing binary JAR file. This method is useful in situations where there are licensing restrictions or where the binary file cannot be extracted. However, an OSGi bundle that contains a JAR file is not supported in a pooled JVM environment.

About this task

This task creates a new OSGi plug-in project from an existing binary JAR file. The JAR file must be on your local file system.

Procedure

  1. On the Eclipse menu bar click File > New > Project to open the New wizard.
  2. Expand the Plug-in Development folder and click Plug-in from Existing JAR Archives. Click Next. The JAR selection dialog opens.
  3. Locate the JAR file to convert. If the file is in your Eclipse workspace, click Add. If the file is in a folder on your computer, click Add External and browse to the JAR file. Select the required file and click Open to add it in the Jar selection dialog. Click Next. The Plug-in Project Properties dialog opens.
    A screen capture of the New Plug-in from existing JAR Archives wizard
  4. In the Project name field enter the name of the project that you want to create. A project name is mandatory.
  5. Complete the following fields in the Plug-in Properties section as required:
    Plug-in ID
    The plug-in ID is automatically generated from the project name, however you can change the ID if you want to.
    Plug-in Name
    The plug-in name is automatically generated from the project name, however you can change the name if you want to.
    Execution Environment
    This field specifies the minimum level of JRE required for the plug-in to run. Select the Java level that matches the execution environment in your CICS® runtime target platform.
  6. In the Target Platform section, select an OSGI framework and select standard from the menu.
  7. Ensure that Unzip the JAR archives into the project is not selected and click Finish. Eclipse creates the plug-in project in the workspace. The project contains the binary JAR file but the project is not supported in a pooled JVM environment.
  8. Required: Requirement: You must now edit the plug-in manifest file and add the JCICS API dependencies. If you do not perform these steps, you will be able to export and install the bundle, but it will not run.
    1. In the Package Explorer view, right-click the project name and click PDE Tools > Open Manifest. The manifest file opens in the manifest editor.
    2. Select the Dependencies tab and in the Imported Packages section, click ADD. The Package Selection dialog opens.
    3. Select the package com.ibm.cics.server and click OK. The package is displayed in the Imported Packages list.
    4. Optional: Optional: Repeat the previous step to install the following package, if required for your application:
      Table 1.
      Package Description
      com.ibm.record The Java API for legacy programs that use IByteBuffer from the Java Record Framework that came with VisualAge. Previously in the dfjcics.jar file.
    5. Press Ctrl +S to save the manifest file.

Results

You have successfully created the plug-in project in the workspace. However you must now update the manifest file to add a CICS-MainClass declaration. For more information see the related links.