h2o
之前可以在我的笔记本电脑上运行,但我有一段时间没有使用它了
(并且同时安装了新的软件包并更新了一些东西)。昨天我尝试使用它,但没有成功。我删除了R
h2o
打包并重新安装h2o
从头开始与
install.packages("h2o")
我尝试跑步h2o
with h2o.init()
但它给了我这个错误
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
Starting H2O JVM and connecting: ............................................................
[1] "localhost"
[1] 54321
[1] TRUE
[1] -1
[1] "Failed to connect to localhost port 54321: Connection refused"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to localhost port 54321: Connection refused
[1] 7
Error in h2o.init() : H2O failed to start, stopping execution.
当我查看错误日志时,它显示
Only Java 1.6-1.8 supported, version is 9
我试图寻找更多信息,我认为该错误是由这段代码1836 行:
if (version != null && !(version.startsWith("1.6") || version.startsWith("1.7") || version.startsWith("1.8"))) {
System.err.println("Only Java 1.6-1.8 supported, version is " + version);
return true;
所以它看起来h2o
正在检查以 1.6、1.7 和 1.8 开头的版本,但由于某种原因我的版本以 9 开头!
然而,在终端上,java -version
gives
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (Zulu 8.20.0.5-macosx) (build 1.8.0_121-b15)
OpenJDK 64-Bit Server VM (Zulu 8.20.0.5-macosx) (build 25.121-b15, mixed mode)
and which java
gives
/Users/myusername/anaconda3/bin/java
- - - - - - 编辑 - - - -
更多信息:/usr/libexec/java_home -V
gives
Matching Java Virtual Machines (4):
9, x86_64: "Java SE 9" /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
1.8.0_144, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
1.8.0_51, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home
1.8.0_25, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
这解释了9
that h2o
正在看到。我觉得它的期望很奇怪1.x.0
但版本只是9
。无论如何,看来我需要指出这一点h2o.init()
命令到1.8
java,但我不知道该怎么做。
我通常使用brew
安装大多数东西,但我从不使用java
所以我对版本一无所知。
谢谢,最好的!