Using Java and JVM COBOL Together
- On Linux, you need to use the Java/COBOL launcher, cobjrun, to call COBOL from Java. However, an attempt to call COBOL from Java using the Eclipse IDE might fail with error "Specified executable /opt/microfocus/VisualCOBOL/bin/cobjrun does not exist for jdkversion". This is because Java searches for the cobjrun executable in the bin directory of the JDK installation. To work around this, you need to add a symbolic link to cobjrun in the bin directory of the JDK installation and then specify this link as the JAVA executable. Read
Java/COBOL Application Launcher for more.
- When calling a COBOL method from Java, even if it is known that the COBOL method may throw exceptions, it is not possible to use a
catch block in the Java to catch that particular exception. It is possible to catch
java.lang.Exceptions in the Java, and from there to determine the actual exception type.