centos 安装 jdk
下载jdk-8u51-linux-x64.rpm
执行 rpm -vih jdk-8u51-linux-x64.rpm
设置环境变量:
vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.xxxx
export CLASSPATH=%JAVA_HOME%/lib/dt.jar:%JAVA_HOME%/lib/tools.jar:%JAVA_HOME%/lib/rt.jar
export path=%path%:=%JAVA_HOME%/bin
执行
source /etc/profile