Problem:
On HP/UX the following command:
: cobjrun -version
Produces the following output:
Error occurred during initialization of VM
Unable to load native library: /opt/java1.3/jre/lib/PA_RISC/libjava.sl
Resolution:
The HP/UX environment should be set up as follows:
1.2.1.4 Environment Variable Settings for HP-UX
This section lists example environment variable settings that enable COBOL/Java working on HP-UX platforms, using the default JVM which was selected when Server Express was installed. You will need to change the settings given below to specify the relevant directories on your system.
export JH=/usr/java1.2
export COBDIR=server-express-directory
export PATH=$JH/bin:$PATH
export PATH=$COBDIR/bin:$PATH
export SHLIB_PATH=$JH/jre/lib/PA_RISC:$JH/jre/lib/PA_RISC/hotspot:
$JH/jre/lib/PA_RISC/native_threads:$COBDIR/lib:$SHLIB_PATH
export CLASSPATH=$COBDIR/lib/mfcobol.jar:$JH/jre/lib/rt.jar:.
export COBCPY=$COBDIR/cpylib
export PATH=/usr/X/bin:$PATH
where server-express-directory is the directory in which Server Express is installed.
To change to a different JVM, add a PATH setting that points to the directory where the Java environment for that JVM is located. The line takes the form:
export PATH=$COBDIR/bin/jdkn.n:$PATH
where n.n is 1.2 for JVM Version 1.2.n or 1.3 for JVM Version 1.3.n.. This line must appear after the line:
export PATH=$COBDIR/bin:$PATH
To revert to the default JVM, just remove or comment out the line.