先找最新版本的oracle JDK
http://www.oracle.com/technetwork/java/javase/8u-relnotes-2225394.html
筆者這邊選擇8u101的版本
點選8u101,看java build的版號
在terminal輸入剛剛查到的版號
sudo wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u101-b13/jdk-8u101-linux-x64.rpm |
rpm install
sudo rpm -ivh jdk-8u101-linux-x64.rpm |
Reference
- Easily install Oracle JDK8 on your EC2 instance https://medium.com/@mertcal/easily-install-oracle-jdk8-on-your-ec2-instance-9317644a42fa#.45igvx31r
- Downloading Java JDK on Linux via wget is shown license page instead http://stackoverflow.com/questions/10268583/downloading-java-jdk-on-linux-via-wget-is-shown-license-page-instead