]> source.dussan.org Git - sonarqube.git/commitdiff
Fix install of JDK8 on Travis
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 24 Apr 2018 12:08:48 +0000 (14:08 +0200)
committerGitHub <noreply@github.com>
Tue, 24 Apr 2018 12:08:48 +0000 (14:08 +0200)
travis.sh

index b8a8c969362ffab87107d759f72adfa81251004d..7ce5695dfd73a4ccde6c44f5a0e0bf44369d8485 100755 (executable)
--- 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"
 }
 
 #