Developing Java applications to use the JZOS Toolkit API in an OSGi JVM server
The IBM® JZOS Toolkit consists of classes in package com.ibm.jzos, which is distributed with the IBM Java™ SDKs for z/OS in a single JAR file ibmjzos.jar.
These classes give Java applications on z/OS direct access to traditional z/OS data sets and files and access to z/OS system services and converter classes for mapping byte array fields into Java data types.
Before you begin
If the JZOS Toolkit API is not downloaded to your workstation, then transfer the
ibmjzos.jar file from the relevant version of the IBM Java SDK on z/OS to your
workstation.
Important: If you are using CICS Explorer® or an Eclipse-based IDE running
version 2022-03 or later, your default compiler compliance level must match the Java version of the target runtime to which the application or sample is deployed
to avoid issues. You can change this setting in CICS Explorer by selecting Preferences, then Java and then Compiler.
Procedure
Results
The application is now ready to be tested, and can be deployed into a CICS OSGi JVM server by
using a CICS Bundle Project as follows:
- Create a CICS Bundle Project in Eclipse and add the OSGi Bundle Project by using the menu New OSGi Bundle Project Include.
- Deploy to zFS by using the menu Export Bundle Project to z/OS UNIX file system.
- Create a CICS BUNDLE definition that references this zFS location and install it.
- Create a CICS PROGRAM definition that names the CICS-MainClass:
com.ibm.cicsdev.jzos.sample.ZFilePrint in the
JVMClass
attribute and install it. - Before you run the application, you need to define an MVS DD in the CICS JCL referencing a valid
MVS data set and then restart your CICS region. For
instance
//INPUT DD DISP=SHR,DSN=CICS.USER.INPUT
- If you need to run the application from a 3270 console, create a TRANSACTION definition that references the PROGRAM defined in step 4.
ZFilePrint
reads the defined MVS data set by
using the JZOS Toolkit API and then write the contents to a CICS temporary storage queue using the
JCICS API.