Creating the JCICS examples

Create the JCICS example projects to understand how to develop Java™ applications that can run in CICS®.

Procedure

  1. In the Eclipse IDE, open the Java perspective.
  2. Set the target platform to the latest release of CICS to work with the JCICS examples.
    Otherwise, compilation errors can occur when you create the examples in your workspace.
    1. Click Window > Preferences from the workbench menu bar.
    2. Expand Plug-in Development and click Target Platform.
    3. Click Add to create a target definition.
    4. Click Template and select CICS TS V5.2 from the list.
    5. Click Next in the wizard and then click Finish.
    6. Select the target definition and click OK.
  3. To create an example plug-in project, use one of the following methods to open the New Example wizard:
    • In the Eclipse menu bar, click File > New > Example.
    • Click the down arrow on the New icon and click Example.
    • In the Project Explorer or Package Explorer view, right-click and click New > Example.
  4. In the CICS Examples > Java folder, select CICS Hello Examples and click Next.
    Screen capture, showing the wizard with examples available in the Java folder.
    • The CICS API examples demonstrate how to use transient data queues, temporary storage queues, and channels and COMMAREAs in Java programs.
    • The CICS bundle OSGi example demonstrates how to create a CICS bundle to deploy to CICS.
    • The CICS hello examples demonstrate two ways to do a simple Hello World test in CICS.
    • The CICS web example demonstrates how to use classes to interact with a web browser.
  5. In the Project name field, enter a name for the new project.
    By default, Eclipse creates a name that is the folder location of the examples in the workspace, followed by the example name.
    For example, the default project name for the Hello World example is com.ibm.cics.server.examples.hello.
  6. Click Finish.
    Eclipse creates the plug-in project that contains the JCICS Hello World example as an OSGi bundle.
    Tip: If the project does not build and the following error occurs, ensure that you completed step 2 successfully:
    Bundle 'com.ibm.cics.server' cannot be resolved
  7. Expand the project in the Package Explorer view.
    Screen capture of the Package Explorer view with the Hello World example project expanded.
    • The Plug-in Dependencies folder contains the dependencies for the OSGi bundle. In this example, the bundle has a dependency on the OSGi bundle that contains JCICS. This information is also captured in the manifest of the project.
    • The src folder contains the Java source for the examples. You can browse the source files to see the JCICS classes that are used and use the context help to look up a particular class. You can also open the Javadoc view to see the API details for the selected content, for example a method or class.
    • The META-INF folder contains the manifest for the project. The manifest contains the OSGi headers to describe the OSGi bundle.
  8. Create plug-in projects for the CICS API and CICS Web examples by using the New Example wizard.
    You can view the Java source to understand how the JCICS classes are used for working with programs and web applications.

Results

You created three plug-in projects in Eclipse for the JCICS examples. These projects contain OSGi bundle packaging information, including plug-in dependencies and target Java environments.