JCEF: the missing libs problem on Linux

Understand

JCEF, the browser component, has the following two main native libs (among others) in JBR (JetBrains Runtime, Java runtime based on OpenJDK that is used to run the IDE):

  • jbr/lib/libcef.so -- CEF/Chromium
  • jbr/lib/libjcef.so -- CEF bridge to JCEF

libjcef.so is loaded from Java (via System.loadLibrary), libcef.so is dynamically loaded from libjcef.so.

libcef.so has lots of dependencies. Incomplete Linux setup can miss some of them. In that case JCEF will not be able to start up, with the errors in idea.log like the following:

java.lang.UnsatisfiedLinkError: /home/sedwards/local/clion-2020.2/jbr/lib/libjcef.so: libXss.so.1: cannot open shared object file: No such file or directory

Identify

Use ldd to identify missing libraries:

$ ldd /path/to/idea/jbr/lib/libcef.so | grep “not found”
libXss.so.1 => not found

Also, to check if a certain library is available in the system for dynamic linking:

$ ldconfig -p | grep libXss

Resolve

Check https://pkgs.org for the correct package name and then install it (with aptitude):

$ sudo apt-get install libXss1

Article is closed for comments.

Have more questions?

Submit a request