By: Paul Kelly, Micro Focus
Welcome to the Visual COBOL book resources page. You can download the examples referenced in Visual COBOL – A Developer’s Guide to Modern COBOL below. The examples are organized by chapter. Each chapter contains a zip file that, when extracted, consists of one or more projects that you can open using either the Visual Studio or Eclipse editions of Visual COBOL. For Visual Studio users, we included a solution file that will load all the projects forming the example. For Eclipse users, you will need to import the projects into a workspace. Since many of the provided examples build upon each other from chapter to chapter, you should use a clean workspace each time – otherwise you will have difficulty importing projects with duplicate names into the same workspace. Chapter 10 contains two versions of the same example – one with full functionality and one as a basis for the worked example used in Chapter 10.
Micro Focus provides a free student edition of Visual COBOL for download and educational use. To learn more about Visual COBOL Personal Edition and to register for your free copy, please visit: Visual COBOL Personal Edition
Have a question? Contact us at visualcobol@microfocus.com
Ch. 1 Why Visual Cobol?
Ch. 2 What You Will Learn from This Book
Ch. 4 Hello World and Managed Platforms
Ch. 6 Inheritance, Exceptions, and Collections
Ch. 7 Interoperating with Procedural COBOL
Ch. 8 Cross-Platform Programming
Ch. 9 Rental Agency Persistence
Ch. 10 Rental Agency User Interface
Ch. 11 Visual COBOL on the Web
Ch. 12 Program Structure and Compilation
Ch. 13 Type Definition
Ch. 14 Data Types
Ch. 15 Statements
Ch. 16 Expressions and Operators
If using Visual COBOL for Eclipse, and you see the error “COBCH1558S Could not start JVM” when importing projects, you can fix this problem by adding the 64-bit JRE to the project’s build path. The version of Visual COBOL used to create the projects specified a 32-bit JRE by default; the latest versions use a 64-bit JRE and if a 32-bit JRE cannot be found this is the error that results.
The supplied Launch configuration does not work with all versions of Visual COBOL for Eclipse. If running PersistentLeases produces a class not found error, create a new launch configuration for main class MicroFocus.COBOL.Examples.MainClass.
The supplied Launch configuration does not work with all versions of Visual COBOL for Eclipse. If running PersistentLeases produces a class not found error, create a new launch configuration for main class COBOL.Book.DateClient.MainClass in project DateClient.
The supplied Launch configuration does not work with all versions of Visual COBOL for Eclipse. If running PersistentLeases produces a class not found error, create a new launch configuration for main class MicroFocus.COBOL.Examples.PersistenceLeases.
If the Java project (JavaLeases) in the COBOL JVM version of the application shows a build path error after import, click Project, Clean, Clean projects selected below, and clean just the JavaLeases project.
If the JavaWebLeases project shows a build path error after import, click Project, Clean, Clean projects selected below, and clean just the JavaWebLeases project.
The text also states that the URL for the application is http://localhost:8080/JavaWebLeases/index.html. The port is sometimes 8085 rather than 8080. If the application doesn’t display in the Web browser as described, double-click the entry for your server in the Eclipse servers window (it is probably labeled Tomcat v8.0 server at localhost) which will display the Overview configuration for your server. You can see the port number used for HTTP/1.1, and change it if necessary (you will need to restart the server for the change to take effect).