The following limits and restrictions apply to the available implementations of native COBOL and Java interoperability:
- COBOL programs must be compiled to an executable file or a shared library; programs compiled to INT/GNT or for
.NET COBOL are not supported.
- All Java files generated from the Compiler or
Visual COBOL utilities should not be modified, and any APIs they use should not be used directly by the user Java or COBOL application.
They are also not supported on the mainframe.
- COMP and COMP-5 data items shared via JAVA-SHAREABLE need to occupy either two bytes or a multiple of four bytes; therefore
it is advisable to compile with the IBMCOMP directive. If you attempt to compile with items that do not meet these sizes,
and without IBMCOMP, an error (COBCH2369) is generated.
- Dynamic length items are not supported in any COBOL/Java interoperability scenario.
- When compiling with DIALECT"ENTCOBOL", shared working-storage item names must not exceed 26 characters in length.
- Applications compiled with JAVA-SHAREABLE and CHARSET(EBCDIC) are limited to MFCODESET=1140.
- Applications that include the Java interoperability discussed in this section are not supported in Enterprise Server.
- Multi-threaded COBOL applications are not supported.
- Any COBOL or Java source files generated by IBM Enterprise COBOL 6.4's Compiler or
cjbuild utility are not compatible with this COBOL product.
- When compiling with the JAVA-CALLABLE directive:
- Passing float (mapped to COMP-1) or double (mapped to COMP-2) from Java to COBOL is not supported due to the limitations
of the COBOL calling convention: COMP-1/COMP-2 cannot be returned from COBOL to Java.
- Passing long (an 8-byte Java primitive type, mapped to 9(18) COMP-5) from Java to COBOL in 32-bit environments is not supported
due to the limitations of the COBOL calling convention.
- COBOL compiled to 32-bit only allows 32-bit returning items in the GOBACK statement; therefore, it is not possible to pass
PIC 9(18) COMP-5 (that is, items of type long) items back to a Java method (due to the COBOL calling convention).