Previous Topic Next topic Print topic


Creating the JVM COBOL Project

First you need to create a project to contain the procedural COBOL program, and make it available for execution from a Java program:
  1. Launch an instance of Visual COBOL for Eclipse.
  2. When prompted for the workspace name, type the name of a folder into which you wish to store the tutorial project (for example, C:\projects (Windows) or ~/projects/ (UNIX)).
  3. If you are presented with the Welcome tab, close it.
  4. Click File > New > Other.
  5. Expand the Micro Focus COBOL node, and select COBOL JVM Project. Click Next.
  6. Type CobolBook in the Project name field.
  7. Ensure that Use default location is checked, and that Use default JRE in JRE is selected.
  8. Click Finish.
This creates a JVM COBOL project to contain the sample procedural COBOL program that you will import into the Web application later in this tutorial.
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. Similarly, any action that uses the dynamic Web project, which comes later in this tutorial, is expected to be carried out in the Java EE perspective. To change perspectives, click on the appropriate option in the top right of the Eclipse main window.

Specifying a Java package

By default, COBOL programs are placed in the default root Java package. JVM servlet containers do not always allow root package classes to be loaded, so you must set up a package for the program.
Note: The Java package system is equivalent to the JVM COBOL namespace system; these two terms are interchangeable.
To set up the package:
  1. In COBOL Explorer, expand the CobolBook project.
  2. Right-click the src folder, and click New > COBOL JVM Package.
  3. Type com.microfocus.book in the Name field. Click Finish to create the package.

This process creates a folder structure in the workspace, in which to store the COBOL program, and informs Java where to find it. You are now ready to set up the COBOL program.

Previous Topic Next topic Print topic