1. download Java
Web: http://www.oracle.com/technetwork/java/javase/downloads/index.html
I got a jdk-6u43-linux-i586.bin.
Ii. Installation
1. I created a Java folder under OPT.
# Mkdir/opt/Java
2. I used winscp to put the JDK file under the/usr/Java folder.
Run the following command:
# Cd/opt/Java
# Chmod A + x jdk-6u43-linux-i586.bin
Give the current user permission to execute the jdk-6u43-linux-i586.bin;
3. Install
#./Jdk-6u43-linux-i586.bin
Run the jdk-6u43-linux-i586.bin, it will show the JDK installation license agreement, flip by space, finallyProgramI will ask you if you agree with the above Agreement. Of course you agree. Enter "yes" and decompress JDK to the current directory. The decompression progress is displayed on the screen.
After decompression, a directory named "jdk1.6.0 _ 43" will be created under the/opt/Java directory. Now we have installed JDK under centos.
4. Open/etc/profile in a text editor
# Vi/etc/profile
Add the following lines at the end:
Export java_home =/opt/Java/jdk1.6.0 _ 43
Export classpath =.: $ java_home/JRE/lib/RT. jar: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export Path = $ path: $ java_home/bin
Iii. delete/uninstall
Run the # rm-fr jdk1.6.0 _ 43 command to delete the JDK. Do not forget to clear the configuration file.