From: Nigel Wade on
On Thu, 22 Apr 2010 01:10:39 -0700, junyoung wrote:

> I have a 64bit jvm now,
>
> $> file /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
> /usr/lib/jvm/java-1.5.0-sun/jre/bin/java: ELF 64-bit LSB executable,
> x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses
> shared libs), stripped
>
> and, my java applications are using 32bit shared libraries to be run
> normally.
>
> $ file libadscli.so
> libadscli.so: ELF 32-bit LSB shared object, Intel 80386, version 1
> (SYSV), not stripped
>
> but, whenever my applications are failed because of the following
> errors.
>
> java.lang.UnsatisfiedLinkError: /home/jykim/work/trunk/ads/ads_home/
> lib/libadscli.so: /home/jykim/work/trunk/ads/ads_home/lib/ libadscli.so:
> wrong ELF class: ELFCLASS32 (Possible cause: architecture word width
> mismatch)
> at java.lang.ClassLoader$NativeLibrary.load(Native Method) at
> java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1753) at
> java.lang.ClassLoader.loadLibrary(ClassLoader.java:1678) at
> java.lang.Runtime.loadLibrary0(Runtime.java:822) at
> java.lang.System.loadLibrary(System.java:993) at
> com.altibase.ads.jdbc.ADSCLI.<init>(ADSCLI.java:33) at
> com.altibase.ads.jdbc.ADSDriver.initialize(ADSDriver.java:117) at
> com.altibase.ads.jdbc.ADSDriver.connect(ADSDriver.java:217) at
> java.sql.DriverManager.getConnection(DriverManager.java:525) at
> java.sql.DriverManager.getConnection(DriverManager.java:193) at
> ads.jdbc.test.common.TestUtil.openConnect(TestUtil.java:99) at
> ads.jdbc.test.common.TestUtil.openConnect(TestUtil.java:88) at
> ads.jdbc.test.ConnectionTest.setUp(ConnectionTest.java:25)
>
> Is there any way to use 32bit shared libraries on 64 bit platforms
> without installing proper jvm version ( in case of, 32bit jvm ).

Not that I am aware of.

You will need to install a 32bit JVM and ensure that you run the correct
one (it's perfectly possible to have multiple versions, and
architectures, of the JVM co-exist quite happily on Linux). Normally all
you need to do is run the correct java executable. Download the latest
JRE from Sun/Oracle. Get the non-RPM version which allows you to extract
it anywhere you like. The RPM version will use the package manager to
install it, and will probably replace your existing version.

--
Nigel Wade