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
File > New > Other.
- Expand the Micro Focus COBOL node and select
COBOL JVM Project. Click
Next.
- Set the
Project name field to "CobolBook".
- Ensure
Use default location is checked.
- Ensure that the JRE is set up to use a Java 6 VM.
- Click
Finish.
This creates a blank JVM COBOL project to contain the procedural COBOL program that will be imported 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.
- Right click on the
src folder in COBOL Explorer and select
Import > Import > General > File System.
- Click
Next.
- Click
Browse and navigate to
<tutorial_source_folder>\COBOLBook\src.
- Click
OK.
- Select
src in the left-hand pane.
- Click
Finish to import the files into the project.