From fde1f46ec49d61dd7aeda8fffbc7db4b7bc4db26 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Thu, 11 Jul 2024 13:29:33 -0700 Subject: [PATCH 1/2] buildscripts: Don't set JDK 8 on OS X from unix.sh We build on many different JDK versions these days, so we should be able to use whatever the environment has available, for the most part. Any specialized configuration should be much earlier, like macos.sh. --- buildscripts/kokoro/unix.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/buildscripts/kokoro/unix.sh b/buildscripts/kokoro/unix.sh index 9b1a4054c7e..1b88b56ab40 100755 --- a/buildscripts/kokoro/unix.sh +++ b/buildscripts/kokoro/unix.sh @@ -23,11 +23,6 @@ readonly GRPC_JAVA_DIR="$(cd "$(dirname "$0")"/../.. && pwd)" # cd to the root dir of grpc-java cd $(dirname $0)/../.. -# TODO(zpencer): always make sure we are using Oracle jdk8 -if [[ -f /usr/libexec/java_home ]]; then - JAVA_HOME=$(/usr/libexec/java_home -v"1.8.0") -fi - # ARCH is x86_64 unless otherwise specified. ARCH="${ARCH:-x86_64}" From 82896cfda559fbdb1e6d6b5249b12e3278434b70 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Thu, 11 Jul 2024 15:32:26 -0700 Subject: [PATCH 2/2] Define the Java version in macos.sh --- buildscripts/kokoro/macos.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildscripts/kokoro/macos.sh b/buildscripts/kokoro/macos.sh index 97259231ee8..c1928a8935b 100755 --- a/buildscripts/kokoro/macos.sh +++ b/buildscripts/kokoro/macos.sh @@ -15,4 +15,6 @@ export GRADLE_FLAGS="${GRADLE_FLAGS:-} --max-workers=2" . "$GRPC_JAVA_DIR"/buildscripts/kokoro/kokoro.sh trap spongify_logs EXIT +export PATH="$(/usr/libexec/java_home -v"1.8.0"):${PATH}" + "$GRPC_JAVA_DIR"/buildscripts/kokoro/unix.sh