Skip to content

Instantly share code, notes, and snippets.

@robobenklein
Created June 25, 2015 23:11
Show Gist options
  • Save robobenklein/84817be7cc3f5e1c9a5d to your computer and use it in GitHub Desktop.
Save robobenklein/84817be7cc3f5e1c9a5d to your computer and use it in GitHub Desktop.
Easily Switch between Webupd8's Java 7 and Java 8 by shell script.
read -p "Which java version should we switch to? 7 or 8? : " action
case $action in
7 ) sudo update-java-alternatives -s java-7-oracle && echo "Switched to Java 7";;
8 ) sudo update-java-alternatives -s java-8-oracle && echo "Switched to Java 8";;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment