1. Download jdk1.6linux from the official Oracle website.
Is:
Http://download.oracle.com/otn-pub/java/jdk/6u32-b05/jdk-6u32-linux-i586.bin
2. The downloaded file is a jdk-6u32-linux-i586.bin file, which can be directly executed with the suffix binfile ..
After the download is complete, you can pass it to the Linux system through FTP.
3. log on to the Linux system and grant the execution permission. The command is as follows:
# Chmod-r 775 jdk-6u32-linux-i586.bin
4. Run JDK installation.
#./Jdk-6u32-linux-i586.bin
During installation, you will be prompted to press the Enter key and press Enter. A jdk1.6.0 _ 32 file will be generated under the current Linux directory.
JDK installation is complete.
5. Configure environment variables.
Environment variables can be configured in several ways, depending on your choice:
Method 1: Configure java_home and path and class_path in the/etc/profile file.
This setting will take effect for the user's shell and affect system security.
Add the following at the end of the file:
Export java_home =/home/webserver/software/linux_jdk/jdk1.6.0 _ 32
Export classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export Path = $ path: $ java_home/bin
Method 2:
Modify the. bashrc file to configure the environment variables:
# Vi. bashrc
Export java_home =/home/webserver/software/linux_jdk/jdk1.6.0 _ 32
Export classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export Path = $ path: $ java_home/bin
After the configuration is complete, use the logout command to exit and then log on again to make it take effect.
Verify whether the installation is successful. Use Java-version to check whether the installation is successful.
# Java-version
Java version "1.6.0 _ 32"
Java (TM) se Runtime Environment (build 1.6.0 _ 32-b05)
Java hotspot (TM) Client VM (build plugin 7-b02, mixed mode, sharing)
[Root @ localhost etc] #