本文介绍了无法在RStudio中加载rJava的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直试图将rJava
加载到我的RStudio设置中,但是它根本无法正常工作.使用命令library(rJava)
时,它可以很好地安装但不会加载.
I have been trying to load rJava
onto my RStudio setup and it just won't work. It installs fine but doesn't load when I use the command library(rJava)
.
这是我尝试过的:-
- 我已经安装了jdk的最新版本,即jdk 9.0.1.
- 我尝试将JAVA_HOME环境变量更改为jdk位置.
- 我已经尝试了中的所有内容一样,但是没有用.
- I have installed the latest version of jdk which is jdk 9.0.1.
- I have tried changing the JAVA_HOME environment variable to the jdk location.
- I have tried everything in this question as well but it didn't work.
我已附上错误消息的屏幕截图:
I have attached the screenshot of the error message:
我正在使用MacBook.
I am working on a MacBook.
推荐答案
要使rJava
在Macbook上工作,必须采取一系列非常具体的步骤,如 rJava问题#86 .
There is a very specific sequence of steps that must be taken to get rJava
to work on a Macbook, as documented in rJava Issues #86.
- 从Oracle下载并安装Java
- 卸载任何以前安装的rJava版本
- 将JAVA_HOME添加到您的.bashrc
- 关闭&重新启动终端,R和RStudio会话,以便它们接收更新的JAVA_HOME
- 使用
install.packages()
安装rJava
- Download and install Java from Oracle
- Uninstall any previously installed version of rJava
- Add JAVA_HOME to your .bashrc
- Close & restart terminal, R and RStudio sessions so they pick up the updated JAVA_HOME
- Use
install.packages()
to install rJava
有关每个步骤的其他详细信息,请参见上面的URL链接.
See the URL link above for additional details on each step.
这篇关于无法在RStudio中加载rJava的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!