From 4af39cc9422bb590f71045f081cf686eb9e86781 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 24 Apr 2018 14:08:48 +0200 Subject: [PATCH] Fix install of JDK8 on Travis --- travis.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/travis.sh b/travis.sh index b8a8c969362..7ce5695dfd7 100755 --- a/travis.sh +++ b/travis.sh @@ -9,18 +9,25 @@ set -euo pipefail # JDK is kept in cache. It does not need to be downloaded from Oracle # at each build. # -function installJdk8 { - echo "Setup JDK 1.8u161" +function installJDK8 { + JDK_RELEASE=171 + echo "Setup JDK 1.8u$JDK_RELEASE" mkdir -p ~/jvm pushd ~/jvm > /dev/null - if [ ! -d "jdk1.8.0_161" ]; then - wget --quiet --continue --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz - tar xzf jdk-8u161-linux-x64.tar.gz - rm jdk-8u161-linux-x64.tar.gz + if [ ! -d "jdk1.8.0_$JDK_RELEASE" ]; then + { + wget --quiet --continue --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz + } || { + echo "failed to download JDK 1.8u$JDK_RELEASE" + exit 1 + } + tar xzf jdk-8u$JDK_RELEASE-linux-x64.tar.gz + rm jdk-8u$JDK_RELEASE-linux-x64.tar.gz fi popd > /dev/null - export JAVA_HOME=~/jvm/jdk1.8.0_161 + export JAVA_HOME=~/jvm/jdk1.8.0_$JDK_RELEASE export PATH=$JAVA_HOME/bin:$PATH + echo "JDK 1.8u$JDK_RELEASE installed" } # -- 2.39.5