Create the JCICS example projects to understand how to
develop Java™ applications that
can run in CICS®.
Procedure
- In the Eclipse IDE, open the Java perspective.
- 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.
- Click from the workbench
menu bar.
- Expand Plug-in Development and
click Target Platform.
- Click Add to create a target
definition.
- Click Template and select CICS
TS V5.1 Runtime from the list.
- Click Next in the wizard and
then click Finish.
- Select the target definition and click OK.
- 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 .
- Click the down arrow on the New icon
and click Example.
- In the Project Explorer or Package Explorer view, right-click
and click .
- In the folder, select CICS
Hello Examples and click Next.
- 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.
- 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.
- 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
- Expand the project in the Package Explorer view.
- 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.
- 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.