| while getopts “hy” OPTION |
| echo "This script will install Oracle JDK 7 and set JAVA_HOME" |
| if [ "$SILENT" = "-y" ]; then |
| sudo apt-get install -y software-properties-common python-software-properties |
| sudo add-apt-repository ${SILENT} ppa:webupd8team/java |
| echo "Registering Oracle Java repository failed." |
| echo "If the error was about add-apt-repository command not found," |
| echo "try one of the following and retry running this script" |
| echo "$ sudo apt-get install software-properties-common" |
| echo "$ sudo apt-get install software-properties-common python-software-properties" |
| sudo apt-get install ${SILENT} oracle-java7-set-default |
| echo "Done. You may need to relogin for the environment variable change to take effect." |