已更新:在此处引用该帖子后: rJava load error in RStudio/R after "upgrading" to OSX Yosemite 我已经解决了问题。 这个也很有用。 Loading rJava on Mac OS High Sierra
我正在尝试安装并需要软件包“ XLConnect”。 当我尝试更新Java时,我已经安装了Java。 我得到的屏幕截图如下,显示我有一个更新的Java版本。
我收到的错误消息如下,并且我安装了软件包 错误消息“ XLConnectJars”提到了它。但是还是没有解决问题。我想知道以前有人遇到过同样的问题吗?任何建议和协助将不胜感激。
> library("XLConnect")
Loading required package: XLConnectJars
Error: package or namespace load failed for ‘XLConnectJars’:
.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.5/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
Reason: image not found
Error: package ‘XLConnectJars’ could not be loaded
> install.packages("XLConnectJars")
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/XLConnectJars_0.2-15.tgz'
Content type 'application/x-gzip' length 14810717 bytes (14.1 MB)
==================================================
downloaded 14.1 MB
The downloaded binary packages are in
/var/folders/v3/4tfsblxs1m314g6pl2bt4t7r0000gn/T//RtmpBJ5q5u/downloaded_packages
> library("XLConnectJars")
Error: package or namespace load failed for ‘XLConnectJars’:
.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.5/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
Reason: image not found