First step: Download the JDK
Http://download.oracle.com/otn-pub/java/jdk/6u35-b10/jdk-6u35-linux-i586-rpm.bin (32-bit)
Step Two: View the version of the system
Getconf Long_bit
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/7A/wKioL1VKQk2C2uI_AACBAaumRmk173.jpg "title=" 003. PNG "alt=" wkiol1vkqk2c2ui_aacbaaumrmk173.jpg "/>
Step Three:
Uninstall the JDK package that comes with the service
Java-version #查看服务器是否安装过jdk
Rpm-qa |grep GCJ #查看服务器安装的jdk软件包信息
libgcj-4.4.4-13.el6.i686
java-1.5.0-gcj-1.5.0.0-29.1.el6.i686
Yum-y removejava-1.5.0-gcj-1.5.0.0-29.1.el6.i686 #卸载软件包
Fourth step: Add permissions to the JDK software execution
chmod a+x Jdk-6u35-linux-i586-rpm.bin
Fifth step: Execute Jdk-6u35-linux-i586-rpm.bin Software
./jdk-6u35-linux-i586-rpm.bin
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6C/7A/wKioL1VKQeeAmMpmAAM_nhU8fP4483.jpg "title=" 002. PNG "alt=" wkiol1vkqeeammpmaam_nhu8fp4483.jpg "/>
Sixth step: Add JDK to system environment variables
Cp/etc/profile/etc/profile.bak #备份当前环境变量
Vi/etc/profile #编辑, add the following at the end
Java_home=/usr/java/jdk1.6.0_35
Path= $PATH: $JAVA _home/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/x11r6/bin
Classpath=.: $JAVA _home/lib/tools.jar: $JAVA _home/lib/dt.jar
Export Java_home
Export PATH
Export CLASSPATH
Seventh step: Make the configuration file effective immediately
Source/etc/profile
Eighth step: Verifying the current JDK version
Java-version
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/7A/wKioL1VKQZ2BGmcoAAJPjh9TMus712.jpg "title=" 001. PNG "alt=" wkiol1vkqz2bgmcoaajpjh9tmus712.jpg "/>
This article is from the "Sky of Lavender" blog, be sure to keep this source http://youlei.blog.51cto.com/2669714/1643672
JDK is compiled and installed under CentOS 6.6 detailed procedure