Skip to content

Commit 2297f3e

Browse files
authored
chore: fix kokoro java17 setup (#360)
1 parent c1f27d2 commit 2297f3e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.kokoro/release.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,14 @@ else
6363
fi
6464
echo "pwd=$(pwd)"
6565

66-
# Make sure `JAVA_HOME` is set and using jdk11.
67-
export JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64
66+
# Make sure `JAVA_HOME` is set and using jdk17.
67+
JDK_VERSION=17
68+
apt-get update
69+
# Install new JDK version
70+
apt-get install -y openjdk-"${JDK_VERSION}"-jdk
71+
export JAVA_HOME="$(update-java-alternatives -l | grep "1.${JDK_VERSION}" | head -n 1 | tr -s " " | cut -d " " -f 3)"
6872
echo "JAVA_HOME=$JAVA_HOME"
73+
6974
mvn clean deploy -B -q \
7075
-P sonatype-oss-release \
7176
--settings=../settings.xml \

0 commit comments

Comments
 (0)