Problems requiring rJava in Windows

早过忘川 提交于 2019-12-05 16:40:25

问题


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).

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’

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

Does anybody know how can I solve this problem?


回答1:


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.

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

java -d64 -version

on the command line as it is mentioned here.

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!




回答2:


The architecture of Java you get for install from the regular Java download web page depends on the architecture of browser you’re using (32-bit or 64-bit) when you download it. This happens without any fanfare. Try the Java manual download page, select the 64-bit version of Java for your OS, install it, and then (after restarting R) try your R packages again.



来源:https://stackoverflow.com/questions/28367964/problems-requiring-rjava-in-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!