Using the Java Native Interface (JNI)

Java programs can also call COBOL programs through a C calling interface known as the JNI. You can use JNI to call the ACUCOBOL-GT runtime DLL in Windows or a shared library that contains COBOL code routines in UNIX.

Windows

To simplify the process of calling an ACUCOBOL-GT program from other programming languages in a Windows environment, the ACUCOBOL-GT runtime is encapsulated in a DLL file, "wrun32.dll".

To call the ACUCOBOL-GT runtime DLL from JNI, you add declarations to the source program for the DLL's initialization, shutdown, and call libraries. Then you call those libraries to initialize the runtime, call the COBOL program, and shut down when you are finished.

For more information on calling the ACUCOBOL-GT runtime DLL, see Calling the Runtime DLL.

UNIX

To access COBOL from Java in UNIX environments, you can place native COBOL code routines in shared libraries and call them from your Java programs via JNI.