本文介绍了无法加载rJava,因为无法加载共享库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在努力在R中加载rJava包。
I have been struggling to load the rJava package in R.
我收到以下消息
> library(rJava)
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared library \
'C:/PROGRA~1/R/R-210~1.1/library/rJava/libs/rJava.dll':
LoadLibrary failure: The specified module could not be found.
Error : .onLoad failed in 'loadNamespace' for 'rJava'
Error: package/namespace load failed for 'rJava'
我已经尝试过这么多解决方案,他们都在脑海里琢磨。
在某些时候我甚至得到了
I have tried so many solutions that they are all bamboozeled in my head.At some point I even got
> R Console: Rgui.exe - System Error The
> program can't start because
> MSVCR71.dll is is missing from your
> computer. Try reinstalling the program
> to fix this problem.
我确保我能想到的一切都在路上
I made sure everything I could think of was on the path
> C:\Program Files\R\Rtools\bin;C:\Program Files\R\Rtools\perl\bin;
C:\Program Files\R\Rtools\MinGW\bin;%SystemRoot%\system32;
%SystemRoot%;%SystemRoot%\System32\Wbem;
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
C:\Program Files\QuickTime\QTSystem\;
C:\Program Files\R\R-2.10.1\library\rJava\libs\;
C:\Program Files\R;C:\Program Files\Java\jre6\bin\client
我接下来应该尝试什么?
What should I try next?
我正在运行R版本2.10.1(2009-12-14)我有还尝试了R版本2.10.1 Patched(2010-03-03 r51210)。它是在Windows机器上运行Windows 7企业
I am running R version 2.10.1 (2009-12-14) and I have also tried R version 2.10.1 Patched (2010-03-03 r51210). It is on a Windows machine running windows 7 enterprise
推荐答案
跟进Dirk的一些圣人建议:
Following up on some of Dirk's sage advice:
- 您的路径应该说
C:\Program Files\Java\jre6\bin\
(删除客户)。 - 您的路径也应该有
C:\Program Files \ R \ R-2.10.1 \bin \
。您不需要对rJava库的显式引用。然后我还会从路径中删除C:\Program Files \ R
。 - 最后,确认Java可以通过要么转到命令提示符并输入
java -version
,要么输入system(java -version)$ c $从R中输入c>。
- 如果您安装了SDK,那么您还需要一个系统变量
JAVA_HOME
在我的情况下指向C:\ Sun \ SDK \
。
- Your path should probably say
C:\Program Files\Java\jre6\bin\
(remove "client"). - Your path should also have
C:\Program Files\R\R-2.10.1\bin\
. You don't need that explicit reference to the rJava libs. I would also then removeC:\Program Files\R
from the path. - Lastly, confirm that Java is accessible by either going to your command prompt and typing
java -version
, or from within R by typingsystem("java -version")
. - If you install the SDK, then you will also want a system variable
JAVA_HOME
which in my case points toC:\Sun\SDK\
.
这篇关于无法加载rJava,因为无法加载共享库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!