linux安装jdk1.7
1.解压
tar -zxvf jdk-7u79-linux-x64.tar.gz
2.编辑环境变量配置文件
vi /etc/profile
直接cp即可 如果jdk的目录不一样 换掉即可
export JAVA_HOME=/usr/local/java/jdk1.7.0_79
export JRE_HOME=/usr/local/java/jdk1.7.0_79/jre
export PATH=$PATH:/usr/local/java/jdk1.7.0_79/bin
export CLASSPATH=./:/usr/local/java/jdk1.7.0_79/lib:/usr/local/java/jdk1.7.0_79/jre/lib
3.生效文件操作
source /etc/profile