The startJVM error was Unable to load native library: libjvm.so solution

  • 2020-04-01 03:25:56
  • OfStack

StartJVM is the method used to load the JVM. It's used in JPype, apache mod, etc. This is used whenever you want to load a JVM process in another language.
Unfortunately, it often goes wrong. Are generally


Unable to load native library: libjvm.so: cannot open shared object file: No such file or directory

But libjvm.so does exist.

The solution is simple:

Set in /etc/profile:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/java/jre/lib/i386/client:/usr/local/java/jre/lib/i386

This will allow you to find other link libraries. That's fine. Simple, but the error message is libjvm.so, and No such file or directory, so it's confusing.


Related articles: