Search code examples
javamacosjrubyrbenvjava-9

How to install JRuby-9.1.13.0 with Java 9?


I'm trying to install JRuby-9.1.13.0 with rbenv on MacOS. The issue is that for some reason still Java 7 (1.7) is required, which no longer officially supported.

rbenv install --verbose jruby-9.1.13.0                                                                                 
ERROR: Java 7 required. Please install a 1.7-compatible JRE.

BUILD FAILED (OS X 10.13.1 using ruby-build 20170914)

The JRuby wiki mentions that Java SE should be installed, but not which specific version. Installed is Java 9.

java -version 
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

A Java 8 version is also installed.

jenv versions
  system
* 1.8 (set by /Users/<folder>/.java-version)
  1.8.0.152
  9.0
  9.0.1
  oracle64-1.8.0.152
  oracle64-9.0.1

Is Java 7 really a requirement for installing JRuby and therefor my setup is wrong? Or is this an issue of JRuby or rbenv and installing JRuby should be also possible with Java 9 (Java 8)?


Solution

  • IIRC I fixed the jenv setup and switched to Java 1.8, then I was able to install JRuby.