错误的 ELF 类:ELFCLASS32
在 Solaris 计算机上运行应用程序时,出现指向某些 .so 文件的错误。然而,该应用程序在我的 Windows 机器上运行得很好。如果我没记错的话,我的应用程序需要 64 位版本,但我在 Solaris 计算机中只有 32 位版本的 .so 文件。有没有办法解决这个问题,以便它使用 32 位版本?我知道它与字节码无关,但可能与 JVM 有关。我尝试使用 -d32 或 -d64 运行,但没有效果。
更新:
这是确切的错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: librvjs11.so: ld.so.1: java: fatal: librvjs11.so: wrong ELF class: ELFCLASS32<br>
at java.lang.ClassLoader$NativeLibrary.load(Native Method)<br>
at java.lang.ClassLoader.loadLibrary0(Unknown Source)<br>
at java.lang.ClassLoader.loadLibrary(Unknown Source)<br>
at java.lang.Runtime.loadLibrary0(Unknown Source)<br>
at java.lang.System.loadLibrary(Unknown Source)<br>
我已经更新了 LD_LIBRARY_PATH,因此它包含包含上述文件的目录。
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<br>
at java.lang.ClassLoader$NativeLibrary.load(Native Method)<br>
at java.lang.ClassLoader.loadLibrary0(Unknown Source)<br>
at java.lang.ClassLoader.loadLibrary(Unknown Source)<br>
at java.lang.Runtime.loadLibrary0(Unknown Source)<br>
at java.lang.System.loadLibrary(Unknown Source)<br>
I've already updated LD_LIBRARY_PATH so it includes the directory containing the file above.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据另一个答案中的对话,推断JVM是64 位进程。这已在 Solaris 中使用
pflags
命令得到确认。显然,传递给 JVM 的
-d32
标志被忽略了。这是因为 JVM 可能是 64 位的,无法在 32 位模式下运行。因此,解决方案可能是安装 32 位版本的 JVM,并使用它。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.我认为正在发生的情况是,您的应用程序正在使用一个具有自己的预编译二进制文件的库,并且这些二进制文件是 32 位的。
您可以选择获取 64 位版本的二进制文件,或者强制 java 以 32 位运行,这正是
-d32
应该做的。但是,该机器上的jvm可以运行在32位吗?如果不能,那么
-d32
将导致 java 发出警告,指出它无法在 32 位中运行,并且将继续在 64 位中运行。你收到那个警告了吗?
我是 CW,因为 Vineet 正在提供所有帮助。
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.