安裝java 1.8
sudo yum install java-1.8.0 |
安裝java 1.8 和compiler
sudo yum install java-1.8.0-openjdk-devel |
更改java版本
sudo /usr/sbin/alternatives --config javac |
更改javac (java complier)版本
sudo /usr/sbin/alternatives --config javac |
最後記得檢查java/javac版本是否正確
java -version; javac -version |
Reference
- How can I upgrade to Java 1.8 on an Amazon Linux Server? http://serverfault.com/questions/664643/how-can-i-upgrade-to-java-1-8-on-an-amazon-linux-server