CentOS安装JDK 1.7
时间:2015-04-11 02:29 来源:blog.51cto.com 作者:network810
1. JDK 1.7(1.7.0_25)
下载地址为:
http://www.Oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
rpm -ivh /目录/jdk-7-linux-x64.rpm
2. 设置环境变量
这里我们需要找到profile文件,添加环境变量:
在profile文件下面追加写入下面信息:
export JAVA_HOME=/usr/java/jdk1.7.0
export CLASSPATH=.:/jre/lib/rt.jar:/lib/dt.jar:/lib/tools.jar
export PATH=:/bin
保存退出,执行:
#source /etc/profile
#java -version
[root@localhost usr]# java -version
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) Client VM (build 24.75-b04, mixed mode, sharing)
[root@localhost usr]#
(责任编辑:IT)
1. JDK 1.7(1.7.0_25) 下载地址为: http://www.Oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html rpm -ivh /目录/jdk-7-linux-x64.rpm 2. 设置环境变量 这里我们需要找到profile文件,添加环境变量: 在profile文件下面追加写入下面信息: export JAVA_HOME=/usr/java/jdk1.7.0 export CLASSPATH=.:/jre/lib/rt.jar:/lib/dt.jar:/lib/tools.jar export PATH=:/bin 保存退出,执行: #source /etc/profile #java -version [root@localhost usr]# java -version java version "1.7.0_75" Java(TM) SE Runtime Environment (build 1.7.0_75-b13) Java HotSpot(TM) Client VM (build 24.75-b04, mixed mode, sharing) [root@localhost usr]# (责任编辑:IT) |