First, installation
Create the installation directory, set up the installation path under/usr/java, and test the file under this path:
# Mkdir/usr/java
1, Jdk-6u11-linux-i586.bin This is self-extracting files, 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 Jdk-6u11-linux-i586.bin is located)
After you follow the prompts to enter Yes, the JDK is decompressed.
A line of words appears: Do you aggree to the above license terms? [Yes or no]
the installer is asking if you would like to comply with the license agreement you have just seen. Of course agree, enter "Y" or "yes" to return.
2, if use Jdk-6u11-linux-i586-rpm.bin this is also a self-extracting file, but the extracted file is jdk-6u11-linux-i586-rpm package, the implementation of RPM command installed on Linux on it. Install the following:
#chmod 755./jdk-6u11-linux-i586-rpm
#./jdk-6u11-linux-i586-rpm. bin
# RPM-IVH jdk-6u11-linux-i586-rpm
A line of words appears: Do you aggree to the above license terms? [Yes or no]
the installer is asking if you would like to comply with the license agreement you have just seen. Of course agree, enter "Y" or "yes" to return.
Installing the software automatically installs the JDK into the/usr/java/directory.
Second, the configuration
#vi/etc/profile
Add the following content to the inside
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 effective immediately after modification, you can use the following command:
#./etc/profile
Note: the. and/etc/profile have spaces.
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)
Play Linux-JDK installation