Last active
September 10, 2020 12:33
-
-
Save jamieparfet/79451dff1f6e10d95dbf660513ce695e to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
dpkg-query -W -f='${binary:Package}\n' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e '^java-common' | xargs sudo apt-get -y remove | |
sudo apt-get -y autoremove | |
# beware - this removes virtualbox config files | |
dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge | |
mkdir /opt/jdk | |
# download 'jdk-8u221-linux-x64.tar.gz' | |
tar -zxf jdk-8u221-linux-x64.tar.gz -C /opt/jdk | |
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_221/bin/java 100 | |
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_221/bin/javac 100 | |
java -version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment