Building the mixed AMODE COBOL/Java interoperability application

This section describes how to build the mixed AMODE COBOL/Java™ interoperability application.

About this task

It is recommended that you build and run COBOL JNI applications in z/OS UNIX.

Compiling
To compile the COBOL program, use the cob2 command in a z/OS UNIX shell. Specify the RENT, DLL and PGMNAME(LONGMIXED) compiler options. The THREAD option is not mandatory, provided that there is only one COBOL program active in the run-unit at any time.
If the COBOL program includes the file JNI.cpy by using a COPY statement, specify the include subdirectory of the COBOL install directory, typically /usr/lpp/cobol/include, in the search order for copybooks. You can specify the include subdirectory by using the -I option of the cob2 command or by setting the SYSLIB environment variable.
Linking
To prepare the COBOL program for execution, link the object file with the following two DLL side files to create an executable module:
  • libjvm31.x, which is provided with your 64-bit IBM Java Software Development Kit: $JAVA_HOME/lib/s390x/j9vm.
  • igzxjni2.x, which is provided in the lib subdirectory of the COBOL install directory in the z/OS UNIX file system, typically /usr/lpp/cobol/lib. This DLL side file is also available as the member IGZXJNI2 in the SCEELIB PDS.
Do not link with the sidedeck igzcjava.x. This is used only by OO features, which is not supported in the mixed AMODE environment. Linking both igzxjni2.x and igzcjava.x in the same program can lead to ABENDs.
Note: $JAVA_HOME is the home directory of the 64-bit IBM Java Software Development Kit.