Created On:  31 March 2010

Problem:

When attempting to invoke the "cobjrun" command, the following error message appears:

cobjrun: Failed to locate an appropriate executable for tool 'cobjrun'

Resolution:

The problem could be that COBOL has not yet been set up to work with Java on the machine.  Two things must be done:

1) run java_setup
2) run cobsje

The java_setup script is usually executed during installation.  That is, when the main Server Express install script runs, it invokes $COBDIR/bin/java_setup.  But if the person performing the installation decides to opt out of setting up Java, the screen shows:

Should you want to use Java with COBOL later on,
as super user run the command $COBDIR/bin/java_setup
to select the version of Java you wish to use.

On the chance java_setup was not run during installation, there is no harm in running it again.  Log in with root credentials, set the COBDIR environment variable (if it's not already set), then invoke $COBDIR/bin/java_setup.

As for "cobsje", it is described in the Server Express documentation.  Begin here:

http://supportline.microfocus.com/documentation/books/sx51ws02/sx51indx.htm

Then navigate to:  Java and COBOL > 1. Using Java and COBOL Together

It says to invoke:

.$COBDIR/bin/cobsje [-n|-v][-J java_home]

But there is a typo in the documentation; there should actually be a space between the leading period and $COBDIR, so it should look like:

.  $COBDIR/bin/cobsje [-n|-v][-J java_home]

By invoking it with "dot space", the effect is to "source" the script in, so the script is executed as though it were typed at the command line, instead of being executed in a sub-shell.

Usually a person would add this to his or her .profile so it would be invoked automatically at each log in.  Micro Focus recommends "sourcing in" a.k.a. "dotting in" the script $COBDIR/bin/cobsje in the login .profile, so cobsje will be run automatically at each login.
Incident #2509655