NetBeans 7.1 构建错误:java.lang.UnsatisfiedLinkError libXtst.so.6:错误的 ELF 类:ELFCLASS64
由于 NetBeans 7.1 上出现以下错误,我无法使用 jdk 1.7.0 构建我的项目,而同一项目在使用 jdk 1.7.0 的 Eclipse 上运行良好。有谁知道我该如何解决这个问题?
Output:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/jvm/jdk.1.7.0/jre/lib/i386/xawt/libmawt.so: libXtst.so.6: wrong ELF class: ELFCLASS64
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1928)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1928)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1846)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:67)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:47)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1648)
at java.awt.Toolkit.<clinit>(Toolkit.java:1670)
at java.awt.Component.<clinit>(Component.java:595)
Java Result: 1
I can't build my project using jdk 1.7.0 due to following error on NetBeans 7.1 whereas the same one works well on Eclipse with jdk 1.7.0. Does anyone know how can I resolve this issue ?
Output:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/jvm/jdk.1.7.0/jre/lib/i386/xawt/libmawt.so: libXtst.so.6: wrong ELF class: ELFCLASS64
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1928)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1928)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1846)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:67)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:47)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1648)
at java.awt.Toolkit.<clinit>(Toolkit.java:1670)
at java.awt.Component.<clinit>(Component.java:595)
Java Result: 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

这是因为您在 64 位平台上运行 32 位 JVM。安装 64 位 JDK 就可以了。我有同样的错误,因为我正在尝试运行 32 位 JDK。 :-)
我只能猜测 Eclipse 工作的原因。但在我看来,当尝试使用 Swing 运行某些东西时会发生这种情况。 Netbeans 确实如此。然而 Eclipse 运行 SWT;它自己的 GUI 包。
That's because you're running a 32bit JVM on a 64bit platform. Install the 64bit JDK and you're off. I have the same errors because I'm trying to run a 32bit JDK. :-)
I can only guess as to why Eclipse works. But it looks to me that this happens when trying to run something using Swing. Netbeans does. Eclipse however runs SWT; its own gui package.