diff options
author | Bernhard M. Wiedemann <bwiedemann@suse.de> | 2017-11-08 19:46:14 +0100 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2017-11-09 18:28:59 +0100 |
commit | 5d3f4f117a0e8e14618ecbb1a1e08f11e2a1b7ab (patch) | |
tree | 44f4f331c66f9243da6d07e2fe1e295e57f55ac6 /scripts | |
parent | 1850349fba154c46aef288bb15959a4c664f8b77 (diff) |
Make bazel work with java9
unlike earlier versions,
openjdk9 returns "javac 9" when asked for its version
Closes #4004.
PiperOrigin-RevId: 175029317
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bootstrap/buildenv.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/bootstrap/buildenv.sh b/scripts/bootstrap/buildenv.sh index c7e381c33e..5c5061b45d 100755 --- a/scripts/bootstrap/buildenv.sh +++ b/scripts/bootstrap/buildenv.sh @@ -287,8 +287,8 @@ function get_java_version() { || fail "JAVA_HOME ($JAVA_HOME) is not a path to a working JDK." JAVAC_VERSION=$("${JAVAC}" -version 2>&1) - if [[ "$JAVAC_VERSION" =~ javac\ (1\.([789]|[1-9][0-9])).*$ ]]; then - JAVAC_VERSION=${BASH_REMATCH[1]} + if [[ "$JAVAC_VERSION" =~ javac\ ((1\.)?([789]|[1-9][0-9])).*$ ]]; then + JAVAC_VERSION=1.${BASH_REMATCH[3]} else fail \ "Cannot determine JDK version, please set \$JAVA_HOME.\n" \ |