在 Windows 中需要 rJava 的问题 [英] Problems requiring rJava in Windows

查看:29
本文介绍了在 Windows 中需要 rJava 的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 64 位机器,具有最新版本的 R (3.1.2)、最新的 RStudio 版本 (0.98.1091) 和最新的 JAVA(版本 8 更新 31).

I am using a 64-bit machine, with the latest version of R (3.1.2), the latest RStudio version (0.98.1091) and the latest JAVA (Version 8 Update 31).

我试图要求 rJava (rJava_0.9-6),结果是以下错误:

I tried to require rJava (rJava_0.9-6) and the result is the following error:

require(xlsx)
Carregando pacotes exigidos: rJava
Error : .onLoad falhou em loadNamespace() para 'rJava', detalhes: 
chamada: fun(libname, pkgname)
erro: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures.
Failed with error:  ‘package ‘rJava’ could not be loaded’

我已经尝试重新安装 Java,但没有成功.

I already tried to re-install Java with no sucess.

有人知道我该如何解决这个问题吗?

Does anybody know how can I solve this problem?

推荐答案

我认为此时的问题是您的 Java 是 32 位的,而您的 R 是 64 位的.这就是为什么您会收到 R 和 Java 具有不同架构 错误的原因.

I think the problem on this occasion is that your Java is 32-bit, whereas your R is 64-bit. This is why you get a R and Java have different architectures error.

为了检查您在 Windows 上的 Java 版本,请键入:

In order to check what your Java version is on Windows type:

java -d64 -version

在命令行中提到 此处.

我认为一旦你安装了正确的 Java 版本,即 64 位,那么加载你的 xlsx 库就可以了!

I think that once you install the correct Java version i.e. the 64-bit on this occasion then loading your xlsx library will work!

这篇关于在 Windows 中需要 rJava 的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆