1:在/etc/profile下配置环境变量
## java_home
export JAVA_HOME=/usr/local/src/java/jdk1.7.0_71
export PATH=$JAVA_HOME/bin:$PATH
"/etc/profile" 86L, 1932C 已写入
[root@yarui ~]# source /etc/profile
2:初次测试安装是否成功
[root@yarui ~]# java -version
3:问题出现
-bash: /usr/local/src/java/jdk1.7.0_71/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: 没有那个文件或目录
4:问题解决步骤
[root@yarui ~]# yum install glibc.i686
确定吗?[y/N]:y
确定吗?[y/N]:y
5:再测试
[root@yarui ~]# java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode)