Operating System - Linux
1752511 Members
5048 Online
108788 Solutions
New Discussion юеВ

JNI issue: Problem loading a 64 bit shared library

 
SOLVED
Go to solution
Giridhar Shankar
Occasional Contributor

JNI issue: Problem loading a 64 bit shared library

Dear All,

I have a Java application that is compiled and running on an HP itanium box. This application (which is a product from HP) has been compiled using Itanium 32-bit JDK binaries (found under JAVA_HOME/bin/IA64N directory).

Also, I have a C++ application which we built a shared library. This application is a 64-bit application specific to IA64 platform.

When I try loading this shared library in my Java application (for JNI communication) where Java app is compiled using 32-bit JDK while the shared library is 64-bit, I get a run-time error saying "UnsatisfiedLinkError".

Can anybody pls advice how do I go about loading 64-bit shared library into a 32-bit Java app?

I don't have a chance of recompiling the Java app using 64-bit JDK (found under $JAVA_HOME/bin/IA64W) since this app is a product and I don't own the source. Same with C++ app since this too is a part of another HP product.

Your inputs are highly appreciated.

Thanks,
Giri
3 REPLIES 3
Arunvijai_4
Honored Contributor
Solution

Re: JNI issue: Problem loading a 64 bit shared library

Hi Giri,

I think, you can't link a 32 bit application with 64 bit shared library. Either you have to port your app into 64 bit or, library to 32 bit.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Steve Steel
Honored Contributor

Re: JNI issue: Problem loading a 64 bit shared library

Hi

Linking 32-bit and 64-bit object files (.o, .sl, .a) together is not supported. All modules in a program must be linked from either 32-bit objects or 64-bit objects.


Steve STeel
If you want truly to understand something, try to change it. (Kurt Lewin)
Sandman!
Honored Contributor

Re: JNI issue: Problem loading a 64 bit shared library

Well Giridhar you can't mix modes when compiling your application.

cheers!