Wednesday, August 26, 2015

Oracle Java, SmartOS Centos 6 LX branded zone: error while loading shared libraries libjli.so

SmartOS 20150820T062742Z

centos-6 lx-dataset image_uuid b1e082f6-460d-11e5-991a-0bc7df451392 (version 20150819)

I don't know if this happens in other versions or linux distributions.

I've installed Java (using the tar.gz archive downloaded from Oracle). Java 6 and Java 7: same issue.

/usr/java/latest/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

Weird:

 # ldd /usr/java/latest/bin/java
lx_vdso.so.1 =>  (0x00007fffff0b0000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffffee00000)
libjli.so => /usr/java/latest/bin/../lib/amd64/jli/libjli.so (0x00007ffffecf5000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007ffffea00000)
libc.so.6 => /lib64/libc.so.6 (0x00007ffffe600000)
/lib64/ld-linux-x86-64.so.2 (0x00007fffff200000)


Solution:

Create the file /etc/ld.so.conf.d/java.conf and put the following line in it

/usr/java/latest/lib/amd64/jli/

Then run the /sbin/ldconfig command.

# /usr/java/latest/bin/java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b32)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04, mixed mode)

# ldd /usr/java/latest/bin/java         
lx_vdso.so.1 =>  (0x00007fffff0b0000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffffee00000)
libjli.so => /usr/java/latest/bin/../lib/amd64/jli/libjli.so (0x00007ffffecf5000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007ffffea00000)
libc.so.6 => /lib64/libc.so.6 (0x00007ffffe600000)
/lib64/ld-linux-x86-64.so.2 (0x00007fffff200000)

3 comments:

  1. Hi, which version of Oracle Java did you select for lx branded zone centos, the solaris version or the rpm version.
    Actually, I found that both versions are not well functioned in the lx branded zone platform.

    ReplyDelete
    Replies
    1. Not Solaris, since it is Linux, I've installed the RPM downloaded from the Oracle web page.
      Is the Solaris version supposed to work inside an LX zone?

      Delete
  2. I have tried both the solaris version and the linux version.
    So far,
    the solaris version runs just fine and I've met zero bug.
    the linux version met one bug and one segment fault.

    ReplyDelete