1, first to see the server version of the system, is 32-bit or 64-bit
Uname-alinux ay131105092932706327z 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu may 20:59:36 UTC, x86_64 x86_64 x86_64 GNU /linux
X86_64 is 64 bit, if you're not sure, you can change the command again.
Getconf Long_bit64
The above command is to view the current operating mode of the CPU
2. Download the 64-bit version of the JDK
jdk-7u67-linux-x64.rpm
Http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
3, using FTP tools such as XFTP,WINSCP, download good files to the server, I was uploaded to the home folder
4. See if you currently have a JDK installed
Rpm-qa |grep jdkjdk-1.7.0_65-fcs.i586
If any, remove
Rpm-e jdk-1.7.0_65-fcs.i586
5, enter the installation command, do not need to give permission, can directly execute
rpm-ivh/home/jdk-7u67-linux-x64.rpm
6. Setting Environment variables
Vim/etc/profileexport java_home=/usr/java/jdk1.7.0_67export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/ Tools.jarexport path= $PATH: $JAVA _home/binexport java_home CLASSPATH PATH
6. Enter the command to check if the settings are installed.
Javajava-versionjavac
No need to restart the server