The genjava Utility

The genjava utility is a command line utility that generates Java wrapper classes from COBOL shared objects. The classes are required when sharing working-storage items with Java , or when making native COBOL program callable from Java.

If you are making a native COBOL program callable (see Java Calling COBOL Programs), this utility generates the progs.java file that is the Java wrapper class that enables Java to call the COBOL programs compiled with the JAVA-CALLABLE directive.

If you are sharing working-storage items (see Java Accessing COBOL Working Storage Items), this utility generates the strg.java file that is the Java wrapper class that enables the sharing of the items between COBOL and Java.

Within a single run unit, if you are only making one COBOL program callable, or sharing working-storage items from one COBOL program, an alternative method using this utility is to use the JAVA-GEN-PROGS and JAVA-GEN-STRG Compiler directives. Multiple callable programs or working-storage from multiple programs must use genjava to create the necessary files.

The build example Example 4 - Java Calling COBOL and Accessing Working Storage Items makes use of genjava, as it deals with multiple files.