gpt4 book ai didi

java - 加载rJava库时为"unable to load shared object"

转载 作者:行者123 更新时间:2023-12-02 02:12:51 24 4
gpt4 key购买 nike

我必须在 R 上加载 Excel 文件 .xlsx,但是:

library(xlsx)

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/danil/Documents/R/win-library/3.4/rJava/libs/x64/rJava.dll':LoadLibrary failure: Impossibile trovare il modulo specificato.Error: package ‘rJava’ could not be loaded

因此,我尝试安装 Java、Java SE-Development Kit 10 和 Java Runtime Environment 10(64 位)。但是,同样在这种情况下:

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/danil/Documents/R/win-library/3.4/rJava/libs/x64/rJava.dll':LoadLibrary failure: Impossibile trovare il modulo specificato.

我能做什么?

最佳答案

这也发生在我身上(也是 Windows 10),我的问题是环境变量设置不正确。就我而言,我必须这样做

Sys.setenv('JAVA_HOME' = 'C:/Program Files (x86)/Java/jre1.8.0_161/')

只需将文件夹名称更改为计算机中 Java 所在的位置,如果不起作用请告诉我。

关于java - 加载rJava库时为"unable to load shared object",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49710941/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com