我正在尝试加载rJava以便使用xlsx,但我收到以下错误。安装rJava似乎很好:
> install.packages("rJava")
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rJava_0.9-9.tgz'
Content type 'application/x-gzip' length 626627 bytes (611 KB)
==================================================
downloaded 611 KB
The downloaded binary packages are in
/var/folders/5v/x1_rqyqj61qdwhttb57mt77c0000gn/T//Rtmp7YPzeb/downloaded_packages
然后如果我想加载包rJava:
> library(rJava)
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so
Reason: image not found
In addition: Warning message:
package ‘rJava’ was built under R version 3.4.2