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 [[email protected] 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) [[email protected] usr]#
时间: 2024-10-27 19:25:10