本文介绍了让R使用更新版本的java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题与有关。

我正在尝试将RNetLogo与R一起使用并收到以下错误。

I am trying to use RNetLogo with R and get the following error.

nl.path <- "/Applications/NetLogo 5.1.0"
NLStart(nl.path)
Error in .jnew("nlcon/Preprocess") :
  java.lang.UnsupportedClassVersionError: nlcon/Preprocess : Unsupported major.minor version 51.0

根据我的理解,问题是R使用的是旧版本与RNetLogo不兼容的Java。

From what I understood in this other question, the problem is that R is using an old version of Java which is incompatible with RNetLogo.

我安装了Java 8.0希望解决这个问题,但我的理解是,尽管我的计算机上安装了Java 8.0(Mac OS Maverick),但R不会接收它并继续尝试使用旧版本的Java。

I installed Java 8.0 hoping to solve the problem but my understanding is that, despite Java 8.0 being installed on my computer (Mac OS Maverick), R does not pick it up and keep trying to use old versions of Java.

所以我的问题是:如何让R使用Java 8.0而不是任何旧版本?

So my question is : How can I get R to use Java 8.0 instead of any older version?

在终端控制台中,我得到

In the terminal console, I get

java -version :
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

在此先感谢您的帮助,

推荐答案

似乎在Mac OS X上你可以同时拥有多个Java。

Seems like on Mac OS X you can have multiple Java at a one time.

在终端上使用以下命令来检查你有多少个JDK版本。

Use below command on terminal to check how many JDK version you have.

您可以按照以下说明进行正确的Java路径设置:

You can follow below instruction to have correct Java Path setup:

简而言之:

这篇关于让R使用更新版本的java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 13:30
查看更多