java.lang.UnsatisfiedLinkError: /openjdk/lib/libawt_xawt.so: libXtst.so.6: cannot open shared object file:

Recently we were working with apache poi. And we switched to openjdk16 from oracle java 1.8.  On our test server we started seeing the following error:

java.lang.UnsatisfiedLinkError: /openjdk/lib/libawt_xawt.so: libXtst.so.6: cannot open shared object file: 

So looking at the error we saw that 

ls -l /openjdk/lib/libawt_xawt.so

was listing the file. So the file was there.

And the line of code that was causing the error was :

palette.setColorAtIndex(HSSFColor.HSSFColorPredefined.LIME.getIndex(), (byte) 212, (byte) 222, (byte) 152);

So looking around the web, we found some libs need to be installed. So the following installations resolved the error:

sudo apt-get install libxi6

sudo apt-get install libxtst6

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.