libjvm.so:无法打开共享对象文件:没有这样的文件或目录
2022-09-01 08:11:26
尝试在我的 14.10 ubuntu 上的 R 上安装 rJava 包,使用此代码
if (!require(rJava)) install.packages('rJava')
得到一些与java相关的错误,包括jni问题,重新安装jdk后,并尝试再次运行相同的代码,得到那个错误
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/usr/local/lib/R/site-library/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpfFjrp0/downloaded_packages’
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called ‘rJava’
寻找解决方案,找到几乎每个人都建议(对于x64)执行这些命令
export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-oracle/lib/amd64:/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server
sudo R CMD javareconf
但这没有奏效,我还能做其他事情吗?我将提供任何需要的详细信息