Skip to content

Commit baca6e4

Browse files
philwodslomov
authored andcommitted
Fix bazelbuild#2982: Bazel installer should not check for installed JDK if using a bundled JDK.
PiperOrigin-RevId: 156092071
1 parent 33e35aa commit baca6e4

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

scripts/packages/template_bin.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,20 @@ if [ -z "${JAVA_HOME-}" ]; then
115115
;;
116116
esac
117117
fi
118-
if [ ! -x "${JAVA_HOME}/bin/javac" ]; then
119-
echo >&2
120-
echo "Java not found, please install the corresponding package" >&2
121-
echo "See http://bazel.build/docs/install.html for more information on" >&2
122-
echo "dependencies of Bazel." >&2
123-
exit 1
124-
fi
118+
119+
# Only check for an installed JDK if this version of Bazel does not contain a
120+
# bundled JDK.
121+
case "$0" in
122+
*without-jdk*)
123+
if [ ! -x "${JAVA_HOME}/bin/javac" ]; then
124+
echo >&2
125+
echo "Java not found, please install the corresponding package." >&2
126+
echo "See http://bazel.build/docs/install.html for more information on" >&2
127+
echo "dependencies of Bazel." >&2
128+
exit 1
129+
fi
130+
;;
131+
esac
125132

126133
# Test for write access
127134
test_write "${bin}"

0 commit comments

Comments
 (0)