You can create a plug-in project from an existing JAR file.
This method is useful when the application is already threadsafe and
no refactoring or recompiling is required. The OSGi bundle can run
in a pooled JVM environment and a JVM server.
About this task
This task creates a new OSGi plug-in project from an existing
JAR file. The JAR file must be on your local file system.
Procedure
- On the Eclipse menu bar click File > New > Project to
open the New wizard.
- Expand the Plug-in Development folder
and click Plug-in from Existing JAR Archives.
Click Next. The JAR selection
dialog opens.
- 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.
- In the Project name field enter
the name of the project that you want to create. A project name is
mandatory.
- 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.
- In the Target Platform section, select an OSGI
framework and select standard from
the menu.
- Ensure that Unzip the JAR archives into the
project is selected and click Finish. Eclipse creates the plug-in project in the workspace.
- 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.
- In the Package Explorer view, right-click the project
name and click PDE Tools > Open Manifest. The manifest file opens in the manifest editor.
- Select the Dependencies tab and
in the Imported Packages section, click ADD. The Package Selection dialog opens.
- Select the package com.ibm.cics.server and
click OK. The package is displayed
in the Imported Packages list.
- Optional: Repeat the step above
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. |
- Press Ctrl +S to save the manifest file.
Results
You have created an OSGi plug-in project from an existing
JAR file. However you must now update the manifest file to add a CICS-MainClass
declaration. For more information see the related links.