Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Sorry unable to load libcobjvm_sun_150_64

Sorry unable to load libcobjvm_sun_150_64

Problem

When running cobsje, the following error is displayed

        Sorry unable to load libcobjvm_sun_150_64

If libcobjvm_sun_150_64 is on shared library PATH, then ensure

 'libjava' and

 'java'

are found on the PATH/Shared Library PATH.

 Resolution

You need a 64 bit version of libjvm.so available

Either search on your system to find one or down load java jdk.

Then point JAVA_HOME to this location in a setup.sh script and run it.

setup.sh

#
JAVA_HOME=/home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk
export JAVA_HOME

COBMODE=64
export COBMODE
#
COBDIR=/home/products/sx51ws8
export COBDIR
#
LD_LIBRARY_PATH=$COBDIR/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
#
PATH=$JAVA_HOME/bin:$COBDIR/bin:$PATH
export PATH
#
cob -v
cob -V
#
#
# this sets up the classpaths and other enviroment variables.
# note the .  cobsje
#      the .  this will set the environment variables in the current shell
#      This can cause headaches if you don't do this
#
echo "execute cobsje"
. cobsje -v -J $JAVA_HOME
echo "execute WhatJava"
cobjrun -classpath "/home/products/sx51ws8/lib" WhatJava
echo "execute WhatJavaVersion"
cobjrun -classpath "/home/products/sx51ws8/lib" WhatJavaVersion
#
# end
#

Here is the output from running the setup.sh.

Output from running command

/home/tonyt/test/2813737oocobol >. ./setup.sh
cob64 -C nolist -v 
I see no work
version @(#)cob.c	5.1.4.0
PRN=RXCTS/AAD:9r.B1.51.09
PTI=WrapPack 8
PTI=ES
I see no work
execute cobsje
COBJVM=sun_150_64
JAVA_HOME=/home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk
LD_LIBRARY_PATH=/home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk/jre/lib/amd64:/home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk/jre/lib/amd64/server://home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk/jre/lib/amd64/native_threads:/home/products/sx51ws8/lib:
PATH=/home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk/jre/bin:/home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk/bin:/home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk/bin:/home/products/sx51ws8/bin:/u01/app/oracle/product/11.2.0/xe/bin:/usr/java/jdk1.7.0_13/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/tonyt/bin
CLASSPATH=/home/products/sx51ws8/lib/mfcobol.jar:.:/home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk/jre/lib/rt.jar:/home/products/sx51ws8/lib/mfimtk.jar:/home/products/sx51ws8/lib/xerces.jar:/home/products/sx51ws8/lib/castor-0_9_4_1-xml.jar:
COBCPY=/home/products/sx51ws8/cpylib:
Java version = 1.5.0_17
Java vendor = Sun Microsystems Inc.
Java OS name = Linux
Java OS arch = amd64
Java OS version = 2.6.39-400.215.3.el6uek.x86_64
execute WhatJava
Java version = 1.5.0_17
Java vendor = Sun Microsystems Inc.
Java OS name = Linux
Java OS arch = amd64
Java OS version = 2.6.39-400.215.3.el6uek.x86_64
execute WhatJavaVersion
1.5.0_17
/home/tonyt/test/2813737oocobol >

Solving this problem

Notes and output

How to solve this problem.
Sorry unable to load libcobjvm_sun_150_64

Use the ldd command to find what libcobjvm_sun_150_64 was trying to load.

/home/tonyt/test/2813737oocobol >cd /home/products/sx51ws8
/home/products/sx51ws8 >cd lib
/home/products/sx51ws8/lib >ls *sun*
libcobjvm_sun_142.so  libcobjvm_sun_150_64.so  libcobjvm_sun_150.so  libcobjvm_sun_160_64.so  libcobjvm_sun_160.so
/home/products/sx51ws8/lib >ldd libcobjvm_sun_150.so
	linux-gate.so.1 =>  (0xf7719000)
	libjvm.so => not found
	libhpi.so => not found
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xf75fa000)
	libm.so.6 => /lib/libm.so.6 (0xf75d0000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xf75b1000)
	libc.so.6 => /lib/libc.so.6 (0xf7421000)
	/lib/ld-linux.so.2 (0x41636000)
/home/products/sx51ws8/lib >

libjvm.so not found. use a unix find command to see if libjvm.so on your system.

/home/tonyt/test/2813737oocobol >su
Password: 
/home/tonyt/test/2813737oocobol >find / -name "libjvm.so" -print
/home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk/jre/lib/amd64/server/libjvm.so

Use this command to check it is 64 bit
/home/products/sx51ws8/lib >file /home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk/jre/lib/amd64/server/libjvm.so
/home/products/oracle/u01/app/oracleclient/product/11.2.0/client_1/jdk/jre/lib/amd64/server/libjvm.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
/home/products/sx51ws8/lib >

Set JAVA_HOME to point at this JDK, and cobjrun will work okay.

NOTE: Watch the space after the . in this comand, as not having it is a common mistake

. cobsje -v -J $JAVA_HOME

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2015-03-18 17:25
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.