Created
September 27, 2018 10:01
-
-
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
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
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