Writing a Java Class in OO COBOL

To write a class in OO COBOL which can be called from Java, you need to do the following:

  1. Set the following directive in your program:
    $set ooctrl"+p-f"
  2. Ensure that the OO COBOL class inherits from javabase.
  3. Create a Java wrapper class for the OO COBOL class. The wrapper class must have the same class name as the filename of the OO COBOL class.
  4. For each method that you create in your OO COBOL class, create a corresponding method in the Java wrapper class.
  5. Package the class inside a .dll file when deploying it on Windows platforms.

    You can also use classes compiled to .int or .gnt, but this does not allow you to package several classes inside one file.