Operating System - Linux
1753534 Members
5424 Online
108795 Solutions
New Discussion юеВ

java.lang.UnsatisfiedLinkError

 
SuryaCA
New Member

java.lang.UnsatisfiedLinkError

Hello All,
I have generated a shared library with gcc using the following compile and linking options:
compiling options:
gcc -fPIC -D_REENTRANT -mpa-risc-2-0

Linking options:
gcc -lc -shared -mpa-risc-2-0

When I access the generated shared library using java( using System.load() ) it is giving the following error:
java.lang.UnsatisfiedLinkError: /home/kodsu03/anotherCB/libHpuxPariscStats.so: sp
ecified file is not a shared library, or a format error was detected.
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1585)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1456)
at java.lang.Runtime.load0(Runtime.java:737)
at java.lang.System.load(System.java:811)

I have the following configuration:
gcc - version 4.2.1(64 bit PARSIC gcc)
OS: HP-UX 11.23(PARISC 64bit)
JDK - 1.4.2.03 64bit


I would appreciate any help on this.

Thanks in advance.

Regards,
Surya.


2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: java.lang.UnsatisfiedLinkError

Shalom Surya,

You may wish to update JDK from http://www.hp.com/go/java

The Java you use is out of date and buggy. There are a number of highly recommended OS patches listed on the site above which you might find useful in diagnosing this problem.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor

Re: java.lang.UnsatisfiedLinkError

>specified file is not a shared library, or a format error was detected.

This says your shlib format is wrong. What does "file libHpuxPariscStats.so" show?

>gcc - version 4.2.1(64 bit PARISC gcc)
>JDK - 1.4.2.03 64bit

Are you sure you are invoking the 64 bit java?
Are you only compiling C code and not C++?