r.java更新,让R使用更新版本的java

This question is related to this other question.

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

nl.path

NLStart(nl.path)

Error in .jnew("nlcon/Preprocess") :

java.lang.UnsupportedClassVersionError: nlcon/Preprocess : Unsupported major.minor version 51.0

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.

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.

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)

Thanks in advance for your help,

解决方案

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

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

/usr/libexec/java_home -V

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

In nutshell do:

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值