使用Rscript加载rJava.dll失败

时间:2013-11-05 12:32:36

标签: r rjava rscript

我通过Eclipse运行R 3.0.1并没有问题。我尝试使用Rscript.exe执行一些我的R脚本,但是我收到以下错误:

Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'H:/R/R-3.0.1/library/rJava/libs/x64/rJava.dll':
LoadLibrary failure:  The specified path is invalid.

我已经检查过,目录中存在DLL。

你有什么建议吗?

感谢。

此致

1 个答案:

答案 0 :(得分:4)

通过添加解决

if (Sys.getenv("JAVA_HOME")!="")
    Sys.setenv(JAVA_HOME="")