libjvm.so: cannot open shared object file: No such file or directory
Solution 1:
Executing the following should solve your problem:
$ export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server
$ sudo R CMD javareconf
Solution 2:
Sometimes you need this R CMD javareconf -e
see https://stackoverflow.com/a/13446026/2803344
Solution 3:
Steps:
Find your R location. It will be stored in
rsession-ld-library-path
inrserver.conf
file. Or just by doingwhich R
. The location usually is/usr/lib64/R/lib
or/usr/lib64/microsoft-r/3.3/lib64/R/lib
Find the
libjvm.so
file which is usually in theusr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
path depending on which jre you're using. Checkecho $JAVA_HOME
.Create a symlink using
ln -s
sudo ln -s /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so /usr/lib64/microsoft-r/3.3/lib64/R/lib/libjvm.so
Restart R server