This solution is provided by using the COBOL/Java Interoperability Project project type.
This project type allows both native COBOL and Java programs to exist in the same project structure; although, within the project, they are stored in their own separate locations - see table below.
The project contains some additional settings that are required for interoperability: the Output Path and Package name options, within the Java Interoperability section of the COBOL project settings, are required to locate the Java artifacts generated by the COBOL compilation. (These options are the equivalent settings to the JAVA-OUTPUT-PATH and JAVA-PACKAGE-NAME Compiler directives.)
Using the default settings for this type of project, the following folders are used for the COBOL and Java artifacts:
Contents | Location |
---|---|
Generated Java sources (progs.java, strg.java, etc...) | Folder specified by Output Path, in the Java Interoperabiltity section of the settings screen (by default, the src folder), and using Package name (by default com.microfocus.COBOL). |
COBOL signature files produced by the COBOL Compiler | As above. |
Java output files | Folder specified by Default output folder, on the Source tab of the Java Build Path screen (by default, the bin folder). |
COBOL output files | Folder specified by Output Path, in the Linkage section of the settings screen (by default, the New_Configuration.bin folder). |
The location of the COBOL sources is dependent on the view you are using; for example, in the COBOL Explorer view, they are displayed in the COBOL Programs folder.
There is also a new launch configuration, COBOL/Java Interoperability Application, which is available to debug these mixed-language projects.
See the following examples of how to configure, build, and run mixed-language projects using the COBOL/Java Interoperability Project project type: