##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget / curl. ### You can download all the binaries one-shot by just providing one BASE_URL. ### Script might be useful if you need Oracle JDK on Amazon EC2 env. ### Script is updated for every JDK release. ### Features:- # 1. Resumes a broken / interrupted [previous] download, if any. # 2. Renames the file to a proper name with including platform info. # 3. Downloads the following from Oracle Website with one shell invocation. # a. Windows 64 and 32 bit; # b. Linux 64 and 32 bit; # c. API Docs; # d. You can add more to the list of downloads are per your requirement. ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ## Latest JDK8 version is JDK8u171 released on 17th Jul, 2018. BASE_URL_8=http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181 JDK_VERSION=`echo $BASE_URL_8 | rev | cut -d "/" -f1 | rev` declare -a PLATFORMS=("-linux-arm32-vfp-hflt.tar.gz" "-linux-arm64-vfp-hflt.tar.gz" "-linux-i586.rpm" "-linux-i586.tar.gz" "-linux-x64.rpm" "-linux-x64.tar.gz" "-macosx-x64.dmg" "-solaris-sparcv9.tar.Z" "-solaris-sparcv9.tar.gz" "-solaris-x64.tar.Z" "-solaris-x64.tar.gz" "-windows-i586.exe" "-windows-x64.exe" "-docs-all.zip") # declare -a PLATFORMS=("-linux-x64.tar.gz" "-windows-x64.exe" "-docs-all.zip") for platform in "${PLATFORMS[@]}" do ### wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" "${BASE_URL_8}${platform}" curl -C - -LR#OH "Cookie: oraclelicense=accept-securebackup-cookie" "${BASE_URL_8}${platform}" done