尝试加载XLConnect包时出错

时间:2017-09-15 11:08:04

标签: r rjava xlconnect

更新到最新版本的Rstudio(R版本3.4.1(2017-06-30) - “单烛”)后,我似乎无法加载XLConnect包。这是我收到的错误消息:

> 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.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
Error: package ‘XLConnectJars’ could not be loaded
当我尝试加载rJava包时,R也会抛出类似的错误消息。我已经尝试卸载Java和R并且已经搜索了SO以获得答案,但似乎没有任何效果。

我正在运行macOS Sierra(10.12.6)

有人愿意提供任何帮助吗?

1 个答案:

答案 0 :(得分:2)

该错误表明加载rJava时出现问题。尝试通过R CMD javareconfsudo R CMD javareconf更新Java配置变量。