# 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"
}
#