2014-07-12 14:21:40

View Mode: Normal | Article List
August, 2014 | 1

Centos JDK 安装及环境变量设置

[ 2014-08-03 17:11:38 | Author: zhenhua ]
1. rpm -ivh jdk-7-linux-x64.rpm

2. vi + /etc/profile
增加:

JAVA_HOME=/usr/java/jdk1.7.0
JRE_HOME=/usr/java/jdk1.7.0/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH

3.使修改生效

source /etc/profile //使修改立即生效
echo $PATH //查看PATH值
1