First you need to create a project to contain the procedural COBOL program and make it available for execution from a Java program:
Create the project
- Click
.
This opens the
New dialog box.
- Expand
Micro Focus COBOL, and then click
COBOL JVM Project.
- Click
Next.
This opens the
New COBOL JVM Project dialog box.
- In the
Project name field, type
CobolBook.
- Ensure
Use default location is checked.
- Ensure that the project is set up to use a Java 7 JRE.
- Click
Finish.
This creates a blank JVM COBOL project to contain the procedural COBOL program that you are to import into the Web application.
Note: If Eclipse prompts you to switch to the COBOL perspective then do so. In general, any action that uses the CobolBook project is expected to be carried out in the COBOL perspective. The dynamic web project that comes later in this tutorial is expected to be done in the Java EE perspective. To change perspectives later, click on the appropriate option in the top right of the Eclipse main window.
Add the COBOL source files
The project uses two source files,
book.cbl and
book-rec.cpy, that need to be imported into your project.
- In COBOL Explorer, right-click the
CobolBook project, and then click
.
This opens the
Import dialog box.
- Expand
General folder, and then click
File System.
- Click
Next.
- Click
Browse and navigate to
<tutorial_source_folder>\COBOLBook\src.
- Click
OK.
- Check
src in the left pane.
- Click
Finish.
This imports the files into the project.