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 OpenJDK from AdoptOpenJDK.
Your COBOL development system currently supports several Java run-time systems.
Before you start writing COBOL and Java programs which interact, you need to set up the following environment variables for the COBOL and Java run-time systems:
The jvm.dll file must be available. Do not move jvm.dll to a different location, because it has dependencies on other files shipped as part of the Java run-time system. The location of this file depends on which version of the JDK you are using. To ensure the file is available, add it to the system PATH. For example:
set path=jdk-install-directory\bin\subdirectory;%path%
Where subdirectory might be client, classic, hotspot or server.
set path=jdk-install-directory\bin;%path%
If you have Java programs that call COBOL, you need to provide access to the Java classes that interface to the COBOL run-time system. To do this, ensure that mfcobol.jar is specified by the CLASSPATH environment variable. For example:
set classpath=install-directory\base\bin\mfcobol.jar;%classpath%;.;
Alternatively, you can set the classpath when you run a Java program, using the -classpath switch. For example:
java -classpath ".;install-directory\base\bin\mfcobol.jar;%classpath%" MyClass
set classpath=jdk-install-directory\lib\tools.jar;%classpath%;.;
The operating system's shared library path must include the directory containing libjava. This is often found in a subdirectory of Java's jre/lib directory, although the name of this directory is specific to each platform. On some platforms, you might need to specify more than one directory for this, for example, an additional directory containing the Java native threading support.