简体   繁体   English

无法在 R 中加载 rJava package

[英]unable to load rJava package in R

I went through many post about this but did not find the solution.我浏览了很多关于此的帖子,但没有找到解决方案。 I am using R 4.0.0 on a 64bit windows computer.我在 64 位 windows 计算机上使用 R 4.0.0。 I am trying yo install rJava, but it does not work.我正在尝试安装 rJava,但它不起作用。

The error message is:错误信息是:

> library(rJava)


Error: package or namespace load failed for ‘rJava’:
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: unable to load shared object 'C:/Users/myself/Documents/R/win-library/4.0/rJava/libs/x64/rJava.dll':
  LoadLibrary failure:  La procédure spécifiée est introuvable.

I am using a 64bits computer.我使用的是 64 位计算机。 I checked the compatibility between R/java.我检查了 R/java 之间的兼容性。

I have installed both java "jdk" (jdk-14.0.1) and "jre" (jre1.8.0_251).我已经安装了 java “jdk”(jdk-14.0.1)和“jre”(jre1.8.0_251)。 I double checked that I am actually using the 64bit version.我仔细检查了我实际上使用的是 64 位版本。 I also tried to keep only one of the two versions, but it did not work...我也尝试只保留两个版本中的一个,但它没有用......

I did not specified any JAVA_HOME path, as it seems to be required in the latest version of rJava ( https://cran.r-project.org/web/packages/rJava/NEWS ).我没有指定任何 JAVA_HOME 路径,因为它似乎在最新版本的 rJava ( https://cran.r-project.org/web/packages/rJava/NEWS ) 中是必需的。

After going through the exact same problem and a lot of testing out JAVA_PATH to no avail I managed to solve it by doing the following:在经历了完全相同的问题并大量测试 JAVA_PATH 无济于事之后,我设法通过执行以下操作来解决它:

The PATH variable in my system variables includes "C:\Program Files\Java\jdk1.8.0_261\jre\bin" and it now works我的系统变量中的 PATH 变量包括“C:\Program Files\Java\jdk1.8.0_261\jre\bin”,现在可以使用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM