Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Loading a 32-bit native library on a 64-bit JVM environment

843829Sep 24 2002 — edited Sep 26 2002
Hello

I have a 3rd party 32-bit native library (abc.so). I am creating a JVM from my 64-bit C code (myC.c). Within this JVM i try to load the 32-bit abc.so
I get the following run-time error

Exception in thread "main" java.lang.UnsatisfiedLinkError: abc.so: ld.so.1: myC: fatal: abc.so: wrong ELF class: ELFCLASS32
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1480)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1404)
at java.lang.Runtime.loadLibrary0(Runtime.java:772)
at java.lang.System.loadLibrary(System.java:832)

When I try to load the same abc.so using a wrapper Java code(instead of myC.c) by running it with java -d32, it works ok.

Do we have any option that we can set while creating a JVM from C, with which we can allow it to load 32-bit native libraries?
Moreover do we have a list of all the options that can be set in the JavaVMInitArgs?

I am using Java 1.4, as 1.3 doesn't support 64-bit JVM.

regards
Rahul
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 24 2002
Added on Sep 24 2002
5 comments
1,125 views