wget http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.tar.gz?AuthParam=1448332478_5660f211ff242080d24210b2315a1116
mv jdk-8u65-linux-x64.tar.gz?AuthParam=1448332478_5660f211ff242080d24210b2315a1116 jdk-8u65-linux-x64.tar.gz
sudo tar zxvf jdk-8u65-linux-x64.tar.gz
vi /etc/profile
最后加入以下几行: i 粘贴 Esc键 :wq回车
export JAVA_HOME=/root/jdk1.8.0_65
export JRE_HOME=/root/jdk1.8.0_65/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile
echo $PATH
sudo chown -R 777 ./*