Java/COBOL Application Launcher

The Java/COBOL application launcher is used to launch a Java application from a COBOL run-time environment.

The Java/COBOL application launcher iscobjrun and it is the trigger for cobjrun32 and cobjrun64. You should use the Java/COBOL application launcher instead of your usual Java application launcher as it sets up your environment to correctly manage both the COBOL run-time system and the Java Virtual Machine.

The command to invoke the Java/COBOL application launcher can take one of two formats:

cobjrun [options] class [arguments]
cobjrun -jar [options] jarfile [arguments]

where the parameters are:

options
The options you would normally specify to your Java application launcher.
class
The name of the class to be invoked. If the Java/COBOL application launcher cannot find a Java class of this name, it tries to find a COBOL program of the same name. If a COBOL program is found, it is executed.
arguments
The arguments to pass to the main function.
-jar
Specifies that a program from a JAR file is to be executed.
jarfile
The name of the Java archive (.jar) file to be invoked.
Note:
  • The Java/COBOL application launcher loads a specified class, and invokes the class's main method, where the method declaration must be in the following format:
    public static void main(String args[])
  • If the Java application is contained in a .jar file, you need to add it to the classpath by using the -classpath (or -cp) option and specifying the fully qualified class-name
  • If you specify a .jar file that contains a manifest including a Main-Class attribute, you can use the -jar option to execute the application
  • In Eclipse, you set up a launch configuration and you specify cobjrun as the executable to run and specify that the multi-threaded run-time system is used