Configuration to activate CICS Java support

No general configuration is necessary to activate CICS® Java™ support. By default, CICS adds the necessary entries to both the CLASSPATH and LIBPATH environment variables, and adds the directory /var/cics_regions/region/classes to the CLASSPATH environment variable. You can add classes directly under /var/cics_regions/region/classes.

Set the following optional environment variables in your region's environment file to affect the operation of Java™ within CICS®:
  • CLASSPATH contains a colon-separated list of directories that are used to search for Java classes.
  • LIBPATH contains a colon-separated list of directories that are used to search for Java native method libraries (.so files).
  • CICS_JAVA_OPTIONS allows you to specify the options that you can specify on the Java command line to the Java virtual machine.
Note: To use Java for TXSeries:
  • On Linux, set the path of the client JVM in LD_LIBRArY_PATH in the /var/cics_regions/region_name environment file as:
    LD_LIBRARY_PATH=<LD_LIBRARY_PATH>:JAVA_HOME/lib/i386/classic
    Where <LD_LIBRARY_PATH> is the currently set LD_LIBRARY_PATH path in your system.
For Java programs that are configured as traditional CICS programs with a PD entry, CICS loads a Java class in response to a request to run a CICS program and tries to pass control to a method that is declared as follows:
public static void main(com.ibm.cics.server.CommAreaHolder CAH)
The class and the method must be public. If such a method is not found, CICS passes control to the standard Java application entry point:
public static void main(String args[])

Enabling class sharing

The Shared Classes feature in TXSeries provides you the capability of reducing virtual memory footprint and improving the JVM startup time. You enable class sharing by adding CICS_JAVA_SHAREDCLASS=1 in your region environment file and restarting the region.

When CICSAS starts a Java transaction with the configured JVM, it creates a class cache having the region name. You need to choose a restricted, platform-dependent default value (typically 16MB) for the size of shared cache. A shared cache in TXSeries is the area of shared memory having a fixed size of 16 MB. The cache exists in shared memory and a configuration file is written to /var/cics_regions/<region_name>/javashared by the JVM to allow all JVM's to locate the shared memory areas by name.

You can destroy the class which is being used by the region using CICSSharedClassUtil example program.