Prerequisite: Install Rzsz for uploading local files
Yum-y Install Lrzsz
First step: Uninstall Linux's own JDK first
Java–version #查看自带jdk的版本rpm-qa | grep Java #查看自带jdk
Unloading:
Rpm-e--nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64rpm-e--nodeps Java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64
Step two: Start uploading, unpacking, installing
Mkdir/usr/local/src/java
RZ #上传自己的jdk
TAR-XVF jdk-7u71-linux-i586.tar.gz #解压上传的jdk
Step Three: Configure environment variables
Vim/etc/profile #查看系统配置文件
#在行末尾添加这一段:
#set java environmentjava_home=/usr/local/src/java/jdk1.7.0_71classpath=.: $JAVA _home/lib.tools.jarpath= $JAVA _ Home/bin: $PATHexport java_home CLASSPATH PATH
The only thing to note here is the JDK version, don't write it wrong, modify it according to your own version.
Save the exit after the modification is complete!
Fourth step: Make the configuration of the changes take effect immediately, use the following command
Source/etc/profile
Fifth step: View the version of the JDK
Java-version
See that it is installed on its own version of the installation is complete!
This article is from the "Simple Life" blog, so be sure to keep this source http://simplelife.blog.51cto.com/9954761/1740139
Installing JDK under Linux