R:'rJava'的包或命名空间加载失败

时间:2018-02-04 18:54:52

标签: r rjava

我在Mac OS El Capitan上运行了RStudio 1.1.419。我正在尝试加载xlsx库。其中一个依赖项是rJava包。当我提交库(xlsx)时,我收到以下错误。

Loading required package: 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 

Error: package ‘rJava’ could not be loaded

我找到了这个帖子:Unable to load rJava on R

基于此,我重新安装了Java并使用了Sys.setenv(JAVA_HOME =“/ Library / Internet Plug-Ins / JavaAppletPlugin.plugin / Contents / Home / bin / java”)来更新路径。我仍然得到错误。

0 个答案:

没有答案