Skip to content

Commit

Permalink
Fix requiring Java 8 for JRuby 9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Nov 2, 2019
1 parent b4e504c commit 9d78f06
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 16 deletions.
14 changes: 10 additions & 4 deletions bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand Down
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.0.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.0.0" "https://s3.amazonaws.com/jruby.org/downloads/9.2.0.0/jruby-bin-9.2.0.0.tar.gz#42718dea5fc90b7696cb3fccf8e8d546729173963ad0bc477d66545677d00684" jruby
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.0.0-dev
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.0.0-SNAPSHOT" "https://projectodd.ci.cloudbees.com/view/JRuby/job/jruby-development-dist/lastSuccessfulBuild/artifact/release/jruby-bin-9.2.0.0-SNAPSHOT.tar.gz" jruby
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.1.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.1.0" "https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.1.0/jruby-dist-9.2.1.0-bin.tar.gz#8c987378b144eff0dcc553312f1853c05ee9135f3ffdac7b0828b7ad62f32835" jruby
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.1.0-dev
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.1.0-SNAPSHOT" "https://projectodd.ci.cloudbees.com/view/JRuby/job/jruby-development-dist/lastSuccessfulBuild/artifact/release/jruby-bin-9.2.1.0-SNAPSHOT.tar.gz" jruby
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.3.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.3.0" "https://s3.amazonaws.com/jruby.org/downloads/9.2.3.0/jruby-bin-9.2.3.0.tar.gz#d9c2d179696394aafe41027f0e48fa53267ecde04b3d10babc88fea4d523336a" jruby
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.4.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.4.0" "https://s3.amazonaws.com/jruby.org/downloads/9.2.4.0/jruby-bin-9.2.4.0.tar.gz#b9638c82c85d89f6e8b2da1b876ac235bb9ed47f2163b3c851f0496c9bd58a0c" jruby
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.4.1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.4.1" "https://s3.amazonaws.com/jruby.org/downloads/9.2.4.1/jruby-bin-9.2.4.1.tar.gz#c89821120d74f17f90c9bc346cc7bd1278df623fc1fe60ea3b5c0a8a01360d5b" jruby
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.5.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.5.0" "https://s3.amazonaws.com/jruby.org/downloads/9.2.5.0/jruby-bin-9.2.5.0.tar.gz#f4ad088082eca73561df983f6cb0a937b966cba3a36454e88f63930ed2bdf349" jruby
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.6.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.6.0" "https://s3.amazonaws.com/jruby.org/downloads/9.2.6.0/jruby-bin-9.2.6.0.tar.gz#70a1ff0e17a98baa63ea92c91fd38ff1e55a2056e5d57ba0409c4543d29e0e3d" jruby
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.7.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.7.0" "https://s3.amazonaws.com/jruby.org/downloads/9.2.7.0/jruby-bin-9.2.7.0.tar.gz#da7c1a5ce90015c0bafd4bca0352294e08fe1c9ec049ac51e82fe57ed50e1348" jruby
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.8.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.8.0" "https://s3.amazonaws.com/jruby.org/downloads/9.2.8.0/jruby-bin-9.2.8.0.tar.gz#b7c58688093f54acd89d732a8bf40e3ae0ac4c92488d6f5b424c33e4fb09c7bb" jruby
2 changes: 1 addition & 1 deletion share/ruby-build/jruby-9.2.9.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_java8
require_java 8
install_package "jruby-9.2.9.0" "https://s3.amazonaws.com/jruby.org/downloads/9.2.9.0/jruby-bin-9.2.9.0.tar.gz#ced3fbb81b4f29f6a7fe7207e678e4154d95cc94de9f509fcaaf05768a6bf911" jruby

0 comments on commit 9d78f06

Please sign in to comment.