尝试使用此代码在我的 14.10 ubuntu 上的 R 上安装 rJava 包
if (!require(rJava)) install.packages('rJava')
在重新安装 jdk 并尝试再次运行相同的代码后,出现了一些与 java 相关的错误,包括 jni 问题,得到了那个错误
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
但这没有用,我还能做些什么吗?我会提供任何需要的细节