1.download
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
.2 set environment
vim /ect/profile , then and this code after
JAVA_HOME=/usr/java/jdk1.8.0_60
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
.3 reflest file by source /etc/profile
.4 terminal run javac ok