Properly detect OpenJDK versions in bin/ruby-build

OpenJDK reports its version slightly different than Oracle Java, and
this was causing the logic in bin/ruby-build to not detect Java 7 or
higher when OpenJDK was used.
This commit is contained in:
Ben Browning 2015-04-29 10:39:40 -04:00
parent 89a23a4688
commit 4c0df6afdb
2 changed files with 13 additions and 1 deletions

View file

@ -701,7 +701,7 @@ fix_rbx_irb() {
}
require_java7() {
local version="$(java -version 2>&1 | grep 'java version' | head -1)"
local version="$(java -version 2>&1 | grep '\(java\|openjdk\) version' | head -1)"
if [[ $version != *1.[789]* ]]; then
colorize 1 "ERROR" >&3
echo ": Java 7 required. Please install a 1.7-compatible JRE." >&3