无法在RStudio中加载rJava

无法在RStudio中加载rJava

本文介绍了无法在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).

这是我尝试过的:-

  1. 我已经安装了jdk的最新版本,即jdk 9.0.1.
  2. 我尝试将JAVA_HOME环境变量更改为jdk位置.
  3. 我已经尝试了中的所有内容一样,但是没有用.
  1. I have installed the latest version of jdk which is jdk 9.0.1.
  2. I have tried changing the JAVA_HOME environment variable to the jdk location.
  3. 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.

  1. 从Oracle下载并安装Java
  2. 卸载任何以前安装的rJava版本
  3. 将JAVA_HOME添加到您的.bashrc
  4. 关闭&重新启动终端,R和RStudio会话,以便它们接收更新的JAVA_HOME
  5. 使用install.packages()安装rJava
  1. Download and install Java from Oracle
  2. Uninstall any previously installed version of rJava
  3. Add JAVA_HOME to your .bashrc
  4. Close & restart terminal, R and RStudio sessions so they pick up the updated JAVA_HOME
  5. Use install.packages() to install rJava

有关每个步骤的其他详细信息,请参见上面的URL链接.

See the URL link above for additional details on each step.

这篇关于无法在RStudio中加载rJava的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-02 02:40