Compile to JVM Bytecode (-j)

Compiles the COBOL source code files into JVM bytecode (.class files), and in some circumstances additional .cbldat static data files.

You can only specify the following file formats with this flag: .cbl, .CBL, .COB or .cob.

You can specify multiple files of the formats listed above, within the same command; each producing their own .class files.

Ensure any .cbldat files are deployed with the compiled source or located on the classpath.

Example

Use the following command to compile the HelloWorld.cbl source file to bytecode:

cob -j HelloWorld.cbl

This produces the following files: HelloWorld.class and HelloWorld.idy.

The bytecode can now be run using the Java/COBOL Application Launcher (cobjrun).