java.lang.UnsatisfiedLinkError with Jrockit JDK while loading C++ library on Solaris (Doc ID 1389272.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle JRockit - Version: R27.5 to R28.2.0 - Release: JRockit to JRockit
Oracle Solaris on SPARC (64-bit)

Symptoms

Exception surfaced while loading 64-bit JNI library from the java code. 

This exception only comes when using a 64-bit Jrockit but it is running successfully using 64-bit Hotspot (previously SUN) jdk.  Used SunStudio 11 compiler to build the c++ code.

Loading library from Solaris 10 with Sun Hotspot JDK , it was successful

bash-3.00$ java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Server VM (build 17.0-b16, mixed mode)


bash-3.00$ java -d64 -Djava.library.path=/home/angautam/wls1032/jdk160_14_R27.6.5-32/bin MyTest
Successful


However loading the same library with Jrockit on solaris 10 the below exception surfaced.

bash-3.00$ java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Oracle JRockit(R) (build R28.1.5-20-146757-1.6.0_29-20111004-1748-solaris-sparcv9, compiled mode)


bash-3.00$ java -d64 -Djava.library.path=/home/angautam/jrockit-jdk1.6.0_29/bin MyTest
Exception in thread "Main Thread" java.lang.UnsatisfiedLinkError: no FTI_Core in java.library.path
       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
       at java.lang.Runtime.loadLibrary0(Runtime.java:823)
       at java.lang.System.loadLibrary(System.java:1029)
       at MyTest.main(MyTest.java:7)


JNI library detail below:


bash-3.00$ ldd libFTI_Core.so
warning: ldd: libFTI_Core.so: is not executable
       libpthread.so.1 =>       /lib/sparcv9/libpthread.so.1
       libdl.so.1 =>    /lib/sparcv9/libdl.so.1
       libiostream.so.1 =>      /usr/lib/sparcv9/libiostream.so.1
       libc.so.1 =>     /lib/64/libc.so.1
       libm.so.2 =>     /lib/64/libm.so.2
       /platform/SUNW,T5240/lib/sparcv9/libc_psr.so.1



bash-3.00$ file libFTI_Core.so
libFTI_Core.so: ELF 64-bit MSB dynamic lib SPARCV9 Version 1, dynamically linked, not stripped


MyTest.java code contains:


bash-3.00$ cat MyTest.java
class MyTest
{

public static void main(String args[])
{
        System.loadLibrary("FTI_Core");
    System.out.println("Successful");


Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms