1. Installation
1) download JDK from the official website
Http://www.oracle.com/technetwork/java/javase/downloads/jdk6u38-downloads-1877406.html
I am here a 32-bit system, so download the jdk-6u38-linux-i586.bin binfile, after downloading, I put it under the/Softs directory
2) grant the executable permission to the Installation File
[Root @ localhost Softs]#Chmod + x jdk-6u38-linux-i586.bin
3) create a Java directory under the/usr directory
[Root @ localhost USR]#Mkdir Java
4) Go to the/usr/Java directory and execute
[Root @ localhost Java]#/Softs/jdk-6u38-linux-i586.bin
2. Configure Environment Variables
1) Open the/etc/profile file
[Root @ localhost USR]#VI/etc/profile
Add the following content at the end of the file:
Java_home =/usr/Java/jdk1.6. 0_38path=$ Java_home/Bin:$ PathClasspath= .:$ Java_home/Lib/Tools. jarexport java_homeexport pathexport classpath
Save and exit
2) execute the following statement to make the environment variable configuration take effect:
[Root @ localhost lib]#Source/etc/profile
3) Verify that the JDK installation and configuration are successful:
[Root @ localhost lib]#Java-versionJava version"1.6.0 _ 38"Java (TM) se Runtime Environment (build1.6.0 _ 38-B05) Java hotspot (TM) Client VM (build20.13-B02, mixed mode, sharing) [root@ Localhost lib]#
3. Delete
If you want to delete the binary file, you can directly Delete the installation directory.
[Root @ localhost USR]#Rm-RF Java