Previous Topic Next topic Print topic


Setting Up the Environment for Java and COBOL

Restriction: This applies to native code only.

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 the Java Software Development Kit (SDK) available from Oracle.

Your COBOL development system currently supports several Java run-time systems.

To run COBOL and Java together, you need to use the Java/COBOL application launcher, cobjrun, instead of the java or cobrun triggers.

The JDK install location must be included on PATH. If the JAVA_HOME environment variable is set to the Java install location, then cobjrun uses it in preference to the Java install location which is included on PATH.

Note:
  • Make sure the cobsetenv script has been run after the installation of the product as described in the install readme. The script sets or modifies the following environment variables: COBDIR, PATH, CLASSPATH and LD_LIBRARY_PATH (or LIBPATH on AIX).
  • On AIX, cobjrun requires that the OS Thread Stack Size is greater than 192k. If this value is lower than 192k, you must execute cobjrun run with the -Xmso192k option - for example, cobjrun -Xmso192k main.

    To check what the OS Thread Stack Size is, executing the following at a terminal: java -verbose:sizes. The OS Thread Stack Size is the number nnn for the "-Xmsonnn" option.

If you are developing a Java or JVM project, you do not have to set the Java installation directory using the JAVA_HOME variable. Follow these steps to identify the JRE or JDK using the Properties dialog boxes:
  1. Select your project in the Navigator pane.
  2. On the Project menu, click Properties.

    The Properties for <project-name> dialog box appears.

  3. Select one of the following:
    • For a COBOL JVM project, click Micro Focus > JVM Build Path.
    • For a Java project, click Java Build Path.
  4. Click the Libraries tab.
  5. Select JRE System Library and click Edit.
  6. Select Alternate JRE, click Installed JREs, then select an installed JRE or JDK and click OK.
    Note: Click Add and use the Add JRE wizard to add a JRE or JDK that is not listed.
  7. Click Finish, then click OK.
Previous Topic Next topic Print topic