Setting Up the Environment for Java and COBOL

You need a Java run-time system on any machine that is going to execute Java applications. If you are going to develop mixed Java and COBOL applications, you will need either the Java Development Kit (JDK) available from Oracle or a compliant JDK such as the OpenJDK from Adoptium (or for AIX platforms, IBM's Semeru Runtime OpenJDK).

Your COBOL development system currently supports several Java run-time systems.

If you have installed the product to a directory other than the default one, ensure you run the cobsetenv script after installation, as described in this product's installation notes. The script sets or modifies the following environment variables: COBDIR, PATH, CLASSPATH and LD_LIBRARY_PATH (or LIBPATH on AIX). If you did install to the default directory, these variables already point to the correct locations.

The JDK install location must be included on PATH.

To run COBOL and Java together, you need to use the Java/COBOL application launcher, cobjrun, instead of the java or cobrun triggers.

If the JAVA_HOME environment variable is set to the Java install location, then cobjrun uses it in preference to the Java install location which is included on PATH.

  • On AIX, cobjrun requires that the OS Thread Stack Size is greater than 192k. If this value is lower than 192k, you must execute cobjrun run with the -Xmso192k option - for example, cobjrun -Xmso192k main.

    To check what the OS Thread Stack Size is, executing the following at a terminal: java -verbose:sizes. The OS Thread Stack Size is the number nnn for the "-Xmsonnn" option.