I. Installation
Create the installation directory, create the installation path under/usr/Java, and obtain the file to this path:
# Mkdir/usr/Java
1. jdk-6u11-linux-i586.bin this is a self-extracting file, installed on Linux as follows:
# Chmod 755 jdk-6u11-linux-i586.bin
#./Jdk-6u11-linux-i586.bin (note that this step must be in the directory where the jdk-6u11-linux-i586.bin is located)
After entering YES as prompted, JDK is decompressed.
A line appears: Do you aggree to the above license terms? [Yes or No]
The installer asks if you are willing to comply with the license agreement you just saw. Of course you have to agree. Enter "y" or "yes" and press Enter.
2, if the use of jdk-6u11-linux-i586-rpm.bin this is also a self-extracting file, but after decompression of the file is a jdk-6u11-linux-i586-rpm package, run the RPM command installed on Linux can be. The installation is as follows:
# Chmod 755./jdk-6u11-linux-i586-rpm
#./Jdk-6u11-linux-i586-rpm. Bin
# Rpm-IVH jdk-6u11-linux-i586-rpm
A line appears: Do you aggree to the above license terms? [Yes or No]
The installer asks if you are willing to comply with the license agreement you just saw. Of course you have to agree. Enter "y" or "yes" and press Enter.
The installation software automatically installs JDK under the/usr/Java/directory.
Ii. Configuration
# Vi/etc/profile
Add the following content to it:
Export java_home =/usr/Java/jdk1.6.0 _ 27
Export java_bin =/usr/Java/jdk1.6.0 _ 27/bin
Export Path = $ path: $ java_home/bin
Export classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export java_home java_bin path classpath
To make the/etc/profile file take effect immediately after modification, run the following command:
#./Etc/profile
Note: There are spaces between. and/etc/profile.
Restart Test
Java-version
Screen output:
Java version "jdk1.6.0 _ 02"
Java (TM) 2 Runtime Environment, Standard Edition (build jdk1.6.0 _ 02)
Java hotspot (TM) Client VM (build jdk1.6.0 _ 02, mixed mode)