Installation steps are as follows: 1.download jdk7.0_10(jdk-7u10-linux-i586.tar.gz) Address: 2. uninstall the built-in open source JDK to check whether JDKrpm-qa | grepjava shows the following information: java-1.4.2-gcj-compa
The installation procedure is as follows:
1. download JDK7.0 _ 10 (jdk-7u10-linux-i586.tar.gz)
Address:
2. uninstall the built-in open source JDK
Check whether JDK is installed
rpm -qa | grep java
The following information is displayed:
Java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
Java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5
Yes, execute the following code to delete it:
rpm –e java
3.beibeijdk-7u10-linux-i586.tar.gz to the installation directory
[root@web-1 soft]# mv java/jdk-7u10-linux-i586.tar.gz /home/software/
4.decompress the jdk-7u10-linux-i586.tar.gz file. after decompression, a new directory named jdk1.7.0 _ 10 will be generated under the/usr/java directory.
[root@web-1 software]# tar zxvf jdk-7u10-linux-i586.tar.gz
Now, the installation is complete. The following describes how to set environment variables.
[root@web-1 software]# vi /etc/profile
Shift + g to the end of the file and add the code:
export JAVA_HOME=/home/software/jdk1.7.0_10export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATHexport CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
Make the environment variable take effect, and execute the configuration file to make it take effect immediately
[root@web-1 software]# source /etc/profile
Run the following command to verify whether the installation is successful:
[root@web-1 software]# java -version
If the following information appears, the installation is successful:
java version "1.7.0_10"Java(TM) SE Runtime Environment (build 1.7.0_10-b18)Java HotSpot(TM) Client VM (build 23.6-b04, mixed mode)
If the following error occurs:
-bash: /home/software/jdk1.7.0_10/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
Solution:
[root@web-1 software]# yum install -y mesa-libGL.i686
So far, jdk has been installed.