Commit 9d78f06d authored by Mislav Marohnić's avatar Mislav Marohnić
Browse files

Fix requiring Java 8 for JRuby 9.2

Ref. #1372, fix #1373, fix #1246
parent b4e504c8
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -798,15 +798,21 @@ fix_rbx_irb() {
    true
}

require_java7() {
  local version="$(java -version 2>&1 | grep '\(java\|openjdk\) version' | head -1)"
  if [[ $version != *[789]* ]]; then
require_java() {
  local required="$1"
  local version="$(java -version 2>&1 | grep '\(java\|openjdk\) version' | head -1 | grep -o '1\.[0-9]\+')"
  if [ -z "$version" ] || [ "${version##*.}" -lt "$required" ]; then
    colorize 1 "ERROR" >&3
    echo ": Java 7 required. Please install a 1.7-compatible JRE." >&3
    echo ": Java ${required} required. Please install a 1.${required}-compatible JRE." >&3
    return 1
  fi
}

# keep for backwards compatibility
require_java7() {
  require_java 7
}

require_gcc() {
  local gcc="$(locate_gcc || true)"

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

Loading