Skip to content

Instantly share code, notes, and snippets.

@jaybuidl
Created September 27, 2018 10:01
Show Gist options
  • Save jaybuidl/4b41ff146a07ee80df4ccda66ad62d69 to your computer and use it in GitHub Desktop.
Save jaybuidl/4b41ff146a07ee80df4ccda66ad62d69 to your computer and use it in GitHub Desktop.
Installs the official OpenJDK 11 binary package and run update-alternatives on a debian system for all java executables
cd ~/Downloads
wget https://download.java.net/java/GA/jdk11/28/GPL/openjdk-11+28_linux-x64_bin.tar.gz
cd /usr/lib/jvm
sudo tar -xvf ~/Downloads/openjdk-11+28_linux-x64_bin.tar.gz
for f in $(find /usr/lib/jvm/jdk-11/bin/ -executable -type f)
do
baseName="$(basename $f)"
echo "setting up $baseName"
sudo update-alternatives --install "/usr/bin/$baseName" $baseName "$f" 9999
sudo update-alternatives --auto $baseName
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment