Step 1: Check whether the built-in JDK of Linux is installed (uninstall centos 1.4 installed)
<1> # rpm-Qa | grep JDK plugin to view JDK information or directly execute
Or
# Rpm-Q JDK
Or
# Java-version
<2> # rpm-Qa | grep gcj release confirm the gcj version number
<3> # Yum-y remove java-1.4.2-gcj-compat uninstall gcj
Step 2: Install JDK
<1> download jdk-1_5_0_14-linux-i586-rpm.bin or jdk-1_5_0_14-linux-i586.bin from sun
Create a Java folder under/USR and put the installation package in the/usr/Java directory.
# Mkdir/usr/Java
<2> install JDK
# Cd/usr/Java
① Install jdk-1_5_0_14-linux-i586-rpm.bin files
# Chmod 777 jdk-1_5_0_14-linux-i586-rpm.bin supervisor modified to Executable
#./Jdk-1_5_0_14-linux-i586-rpm.bin accept select YES to agree to the above agreement
# Rpm-IVH jdk-1_5_0_14-linux-i586.rpm configure Select Yes until installation is complete
② Install jdk-1_5_0_14-linux-i586.bin files
# Chmod A + x jdk-1_5_0_14-linux-i586.bin grants the current user permission to execute
#./Jdk-1_5_0_14-linux-i586.bin plugin Select Yes until installation is complete
Step 3: Configure Environment Variables
<1> # vi/etc/profile
<2> Add the following lines at the end:
Export java_home =/usr/Java/jdk1.6.0 _ 10
Export classpath =.: $ java_home/JRE/lib/RT. jar: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export Path = $ path: $ java_home/bin
<3> # source/etc/profile restart