diff options
author | philwo <philwo@google.com> | 2017-05-15 22:00:47 +0200 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2017-05-15 23:25:31 +0200 |
commit | baca6e4cb023649920871b74810927d304729e59 (patch) | |
tree | 388a01993363cf1c01518bdb5981f984c37eb202 | |
parent | 33e35aa08835eb06cf8f35d693a67e68c7863d13 (diff) |
Fix #2982: Bazel installer should not check for installed JDK if using a bundled JDK.
PiperOrigin-RevId: 156092071
-rwxr-xr-x | scripts/packages/template_bin.sh | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/scripts/packages/template_bin.sh b/scripts/packages/template_bin.sh index 906a3871d3..ae332af6f6 100755 --- a/scripts/packages/template_bin.sh +++ b/scripts/packages/template_bin.sh @@ -115,13 +115,20 @@ if [ -z "${JAVA_HOME-}" ]; then ;; esac fi -if [ ! -x "${JAVA_HOME}/bin/javac" ]; then - echo >&2 - echo "Java not found, please install the corresponding package" >&2 - echo "See http://bazel.build/docs/install.html for more information on" >&2 - echo "dependencies of Bazel." >&2 - exit 1 -fi + +# Only check for an installed JDK if this version of Bazel does not contain a +# bundled JDK. +case "$0" in + *without-jdk*) + if [ ! -x "${JAVA_HOME}/bin/javac" ]; then + echo >&2 + echo "Java not found, please install the corresponding package." >&2 + echo "See http://bazel.build/docs/install.html for more information on" >&2 + echo "dependencies of Bazel." >&2 + exit 1 + fi + ;; +esac # Test for write access test_write "${bin}" |