NetBeans 7.1 building error : java.lang.UnsatisfiedLinkError libXtst.so.6: wrong ELF class: ELFCLASS64

StackOverflow https://stackoverflow.com/questions/8865713

  •  28-10-2019
  •  | 
  •  

Question

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
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top