0
votes

I have a java application which tries to load external libraries but I keep getting the same exception.

Caused by: java.lang.UnsatisfiedLinkError: /test/software/libraries/libraries/bin/libxejni.so: ld.so.1: java: fatal: /test/software/libraries/libraries/bin/libxejni.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method) ~[?:1.7.0_79]
    at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965) ~[?:1.7.0_79]
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890) ~[?:1.7.0_79]
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880) ~[?:1.7.0_79]
    at java.lang.Runtime.loadLibrary0(Runtime.java:849) ~[?:1.7.0_79]
    at java.lang.System.loadLibrary(System.java:1088) ~[?:1.7.0_79]

This is appartantly got to do with a 32-bit JVM trying to load a 64-bit native shared library. However my java version is 64 bit

java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

The applicaton is build using maven, anyone have any clue what the issue could be here?

Thanks

1
Are you certain that the version of Java that's actually running is a 64-bit one? Just running java -version from the command line won't necessarily show the JVM that's being used by your application (e.g. if it's a web app). - Jon Skeet
Yes it's being deployed on a solaris server with java 1.7 64 bit - user3520080

1 Answers

0
votes

Check if libxejni.so the application need to load is 32-bit or 64-bit, then specify java -d32 or java -d64 option for 32-bit or 64-bit so, respectively, when running your application.