问题描述
我正在使用64位Windows 7& 64位R 3.2.0.我已经下载了rJava软件包,但是它给出了如下错误.
I am using 64 bit windows 7 & 64 bit R 3.2.0. I have downloaded rJava package, but it is giving an error as follows.
我在stackoverflow中搜索了答案,并执行了以下操作:
I searched stackoverflow for answers, and did the following:
1)将jvm.dll
文件添加到我的PATH变量中,即在以下目录中:
1) Added the jvm.dll
file to my PATH variable, i.e. in the following directory:
C:\Program Files\Java\jdk1.8.0_25\jre\bin\
2)我正在使用64位R 3.2.0&检查JVM版本是否为64位,在命令行上键入以下内容:
2) I am using 64 bit R 3.2.0 & checked if the JVM version was 64 bit or not, typing the following on the command line:
java -d64 -version
它给出了以下输出:
C:\Users\xyz> java -d64 -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
因此,至少JVM与R匹配.
So at least the JVM matches with R.
那么,要使rJava
工作起来,还需要做更多的事情吗?我还检查了我的PATH变量,看起来还可以.
So what more needs to be done to make rJava
work? I also checked my PATH variable and it seems okay.
推荐答案
我知道这为时已晚,但是您是否尝试过将R版本切换为诊断步骤?
I know this is way too late, but did you try switching R versions as a diagnostic step?
对于RStudio 1.0.136:工具->全局选项...->常规:R版本:更改-选择32位.
For RStudio 1.0.136: Tools -> Global Options... -> General: R version: Change - Choose 32 bit.
更改版本对我有用,并提示我重新访问Java安装. (最终仅使用R32)
Changing versions worked for me and prompted me to revisit my java installation. (Ended up just using R32)
使用R64遇到相同的错误:
Got the same error with R64:
Loading required package: XLConnectJars
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: dirname(this$RuntimeLib)
error: a character vector argument expected
Error: package ‘XLConnectJars’ could not be loaded
使用计算机的默认R64在Windows 10上运行RStudio.
Was running RStudio on Windows 10 using machine's default R64.
这篇关于rJava加载错误-“预期的字符向量"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!