This example demonstrates a simple Java shared class application, used to destroy the
shared class configured by CICS Java program.
You need to ensure that the following directories are in your path before attempting to compile
the JavaShared Java Programs. These include the directories for the Java compiler, make command, as
well as the CICS and Encina commands. The following list shows the standard names for these
directories, however they may be different on your workstation:
- On AIX
- /usr/java7/jre/bin (For Java compiler)
- /bin (For make command)
- /usr/lpp/cics/bin (For CICS commands)
- On Linux
- /opt/IBMJava7/jre/bin (For Java compiler)
- /usr/bin (For make command)
- /opt/cics/bin (For CICS commands)
- On Windows
- "C:\Program Files\IBM\Java7\bin" (For Java compiler)
- "C:\Program Files\VisualStudio\VC98\bin" (For make command)
- "C:\opt\cics\bin" (For CICS commands)
Change to the directory containing the
CICSSharedClassUtil examples. You can
also copy files from the following directory to your own directory and change to that directory if
you do not have authority to write to CICS directory.
- On AIX
- cd ${CICSPATH}/examples/Java/CICSSharedClassUtil
- On Windows
- cd %CICSPATH%\examples\Java\CICSSharedClassUtil
Edit the
CICSSharedClassUtil.mk makefile and make the following changes:
- Change the value of the CICSREGION variable from DEFAULT to the name of the CICS region in which
you will be running this example. The region might have already been created.
- Change the value of the JAVA_HOME variable from DEFAULT to the path where java installed. For example:
- On AIX
- JAVA_HOME=/usr/java7/jre/
- On Windows
- Update the REGIONPATH variable if your \var\cics_regions directory is not
located on the C drive.
- Save the file.
- Compile the Java programs and install the necessary resource definitions into the specified
region. The CICSPATH variable below contains the name of the directory in which CICS was installed,
normally /usr/lpp/cics for AIX, and c:\opt\cics for Windows:
- on AIX
- make -f CICSSharedClassUtil.mk
- On Windows
- nmake -f CICSSharedClassUtil.mk
You can also specify other targets on the make command, such as:
- build: This will build the CICSSharedClassUtil.class files from the
corresponding Java files.
- install: This will install the resource definitions in the specified region.
- deinstall: This will remove the resource definitions from the specified region.
- clean: This will delete the CICSSharedClassUtil.class files from
the current directory.
- Ensure that the CICS classes are included in the region's environment file.
The following are required for this application:
- On AIX
${CICSPATH}/classes/dfjcics.jar:${JAVA_HOME}/lib/ppc/default/jclSC170/vm.jar
${CICSPATH}/classes
- On Windows
%CICSPATH%\classes\dfjcics.jar:%JAVA_HOME\lib\ppc\default\jclSC170\vm.jar
%CICSPATH%\classes
- Set the JAVA_HOME environment variable in the region's environment file. This will be the
location of the Java installation on your system.
The transaction JSHTPROG is installed for this case and you can set the JSHTPROG program in
regionShutdownProgList to destroy the Java shared class whenever region
terminates.