wrong ELF class: ELFCLASS32

匿名 (未验证) 提交于 2019-12-03 01:29:01

问题:

I'm getting this error pointing to some .so file when running my application on a Solaris machine. However, the application runs just fine in my Windows machine. If I'm not mistaken, my application is expecting for the 64-bit version but I only have a 32-bit version of the .so file in the Solaris machine. Is there a way I can fix this so it will use the 32-bit version instead? I understand it has nothing to do with the bytecodes but probably with the JVM. I tried running using -d32 or -d64 but it has no effect.

UPDATE:

This is the exact error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: librvjs11.so: ld.so.1: java: fatal: librvjs11.so: wrong ELF class: ELFCLASS32
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)

I've already updated LD_LIBRARY_PATH so it includes the directory containing the file above.

回答1:

Based on the conversation in the other answer, it was inferred that the JVM was a 64-bit process. This was confirmed using the pflags command in Solaris.

Apparently the -d32 flag passed to the JVM was being ignored. This was due to the possibility of the JVM being a 64-bit one, which was incapable of operating in the 32-bit mode. The resolution might therefore be to install a 32-bit version of JVM, and use the same.



回答2:

What I think is happening is that your app is using a library that has its own pre-compiled binaries, and those are 32 bit.

Your options are either to get a 64 bit version of the binaries, or force java to run in 32 bit which is what -d32 is supposed to do. However, can the jvm on that machine run in 32 bit? If it can't then the -d32 will cause java to spit out a warning that it can't run in 32 bit and that it will continue in 64 bit. Are you getting that warning?

I'ma CW this since Vineet is doing all the helping.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!