參考資料 https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04
Oracle JDK 9
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java9-installer
Managing Java
sudo update-alternatives --config java
Setting the JAVA_HOME Environment Variable
sudo nano /etc/environment
Edit /etc/environment
JAVA_HOME="/usr/lib/jvm/java-9-oracle"
Save and exit the file, and reload it.
source /etc/environment echo $JAVA_HOME