How to fix: jre/lib/i386/xawt/libmawt.so: libXtst.so.6: cannot open shared object file - Java Error on LinuxBy angsuman, Gaea News Network
Wednesday, July 21, 2010
I observed this error while trying to run a Java Awt based application. The typical error message in such situation is:
… jre/lib/i386/xawt/libmawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
You will most likely find, as I did, that libXtst.so.6 exists in your system and is in proper path but still libmawt.so is unable to find it. Baffling isn’t it?
I tried explicitly setting the LD_LIBRARY_PATH so it can find the libXtst.so.6. It worked in that it was able to find the file but then it gave Bad ELF message on trying to use it. That gave me a clue to the solution. The JDK I had installed was by mistake for i386 systems which I had installed on x64 Linux OS (64 bit Linux Operating System). The real error was due to conflicting libraries between 32bit Java libraries and 64bit Linux libraries. The solution was simple.
I replaced the 32bit version of Java with 64bit version and the problem was solved. That was simple, wasn’t it?
Tags: CentOS, JDK 7