Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/java/jdk1.8.0_60/jre/lib/i386/libawt_xawt.so: libXext.so.6: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1842)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at java.awt.Toolkit$3.run(Toolkit.java:1636)
    at java.awt.Toolkit$3.run(Toolkit.java:1634)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Toolkit.loadLibraries(Toolkit.java:1633)
    at java.awt.Toolkit.(Toolkit.java:1668)
    at java.awt.Component.(Component.java:593)
    at EventTest.(EventTest.java:28)
    at EventTest.main(EventTest.java:49)

3 Answers 3

apt-get install libxrender1:i386 libxtst6:i386 libxi6:i386

helped me get this resolved.

I have installed in a 64 bit system also i386.

  • 4
    This worked for me where the other answers would not. Thanks.
    – a coder
    Aug 11, 2017 at 20:34
  • For sure this is correct answer if you're running i386 version of JRE or any other software which depends on this set of libs. You always must match architecture between runtime and shared libs.
    – stamster
    Feb 9, 2018 at 21:16
  • I had to launch 'sudo dpkg --add-architecture i386' command then 'sudo apt-get update' before to be able to install i386 versions of libraries
    – quent
    Dec 7, 2020 at 14:17

Check which package contains the file and install it:

$ apt-file search libXext.so.6 
libxext6: /usr/lib/x86_64-linux-gnu/libXext.so.6 
libxext6: /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
libxext6-dbg: /usr/lib/debug/usr/lib/x86_64-linux-gnu/libXext.so.6.4.0 

So install libxext6:

sudo apt install libxext6
  • sir this method is not working Sep 16, 2015 at 12:55
  • 1
    What part? The apt-file or apt install?
    – JdeHaan
    Sep 16, 2015 at 14:37
  • sir i mean above mentioned error is not rectify by this method Sep 16, 2015 at 17:56
  • So, is the file actually there? sudo find / -name 'libXext*'
    – JdeHaan
    Sep 17, 2015 at 10:09
  • 1
    Could very well be a version conflict in 32-bit vs. 64-bit. Please check out this question on stackoverflow: stackoverflow.com/questions/24543014/…
    – JdeHaan
    Sep 17, 2015 at 10:20

I had to install this (on ubuntu 16.04 64 bit) to make oracle-jdk8 work:

sudo apt-get install libxrender1 libxtst6 libxi6
  • I do not know what, but this fixed my problems after trying hundreds of other apt install whatever commands from other answers!
    – team17
    Dec 19, 2019 at 10:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .