Created
March 12, 2019 04:25
-
-
Save kristi/8a1c2ca7cd3e14501dedd3c4a5f0e81d to your computer and use it in GitHub Desktop.
Install AdoptOpenJdk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -ex | |
cd /tmp | |
VERSION="8u202-b08" | |
VERSION_WITHOUT_DASH="${VERSION/-/}" | |
TARBALL="OpenJDK8U-jre_x64_linux_hotspot_${VERSION_WITHOUT_DASH}.tar.gz" | |
CHECKSUM="b3f9934c6fc83fb2e76a4ded31367e5312013e27d36eac82a6fe1423aae394ce" | |
wget "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk${VERSION}/OpenJDK8U-jre_x64_linux_hotspot_${VERSION_WITHOUT_DASH}.tar.gz" | |
echo "$CHECKSUM $TARBALL" | sha256sum -c | |
tar zxvf "$TARBALL" | |
mv "jdk${VERSION}-jre" /usr/local/share | |
rm "$TARBALL" | |
update-alternatives --install /usr/local/bin/java java /usr/local/share/jdk${VERSION}-jre/bin/java 0 | |
java -version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment