h2o
R
h2o
h2o
install.packages("h2o")
h2o
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
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
java -version
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)
which java
/Users/myusername/anaconda3/bin/java
/usr/libexec/java_home -V
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
h2o
1.x.0
9
h2o.init()
1.8
brew
java
The error you reported says:
Only Java 1.6-1.8 supported, version is 9
Seems like you have Java 9 installed, which is not yet supported by H2O. Use a compatible version of Java and that will fix the error.
If you can't or don't want to uninstall Java 9, then you'll need to tell H2O which Java you'd like to use by setting the JAVA_HOME
environment variable. First, get the location of Java 1.8 by executing the following in a shell:
/usr/libexec/java_home -v 1.8
On my mac, it shows me this:
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
You can check if R can see your JAVA_HOME
variable by running the following command: Sys.getenv("JAVA_HOME")
.
If that's blank (and possibly will be if you're using RStudio), then will have to do a bit more work to get R to see the JAVA_HOME
variable. You can edit the ~/.Renviron
file to add JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
or whatever that location is on your machine. Then restart RStudio and it should work.