Only in the installation of jdk1.6, jdk1.7 and jdk1.8, other versions please detour, the purpose is to facilitate themselves and everyone in the future to do the JDK environment, suffering from no JDK installation package and set the variable process, I will install the package are placed in the cloud disk, need to directly in the connection to find:
The general framework of this chapter: Part One: CENTOS6 (uninstall all packages that were originally associated with the JDK)
1:root user Identity installation RPM installation method and Tar package installation method
2: Normal user identity installation RPM installation method and Tar package installation method
Part II: CENTOS7 (uninstall all packages that were originally associated with the JDK)
1:root user Identity installation RPM installation method and Tar package installation method
2: Normal user identity installation RPM installation method and Tar package installation method
Part III: Experience and suggestions for beginners
The first part: CENTOS6 series
Be sure to start working without any previous JDK environmental impact--------------------------------------------
RPM Package Series
Root user
jdk1.6 version of RPM package: Jdk-6u45-linux-x64-rpm.bin
After execution, look again at the packages that will generate many sun-java-* RPM packages and jdk-6u45-linux-amd64.rpm.
We can use the command to see that these packages are already installed in the system.
In this process, the RPM package is automatically installed, the variable path does not need to be set up, the installation is finished, directly view the version.
jdk1.7 version of RPM package: jdk-7u80-linux-x64.rpm
View RPM Package Installation status
View JDK version
jdk1.8 version of RPM package: jdk-8u151-linux-x64.rpm
View RPM Package Installation status
View JDK version
Tar Package Series
jdk1.6 Version installation package: Jdk-6u45-linux-x64.bin
Export java_home=/usr/local/jdk1.6.0_45
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin
jdk1.7 version of tar package: jdk-7u80-linux-x64.tar.gz
Export java_home=/usr/local/jdk1.7.0_80
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
jdk1.8 Series Tar Package: jdk-8u152-linux-x64.tar.gz
Export java_home=/usr/local/jdk1.8.0_152
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Normal User
Tar Package Series
Root user
Normal User
Do jdk1.6 series: Jdk-6u45-linux-x64.bin
Export java_home=/usr/local/jdk1.6.0_45
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin
Part II: CENTOS7 series
Root user
jdk1.6 version of RPM package: Jdk-6u45-linux-x64-rpm.bin
After execution, review the packages that will generate many sun-java-* RPM packages and jdk-6u45-linux-amd64.rpm
We can use the command to see that these packages are already installed in the system.
In this process, the RPM package is automatically installed, the variable path does not need to be set up, the installation is finished, directly view the version.
jdk1.7 version of RPM package: jdk-7u80-linux-x64.rpm
jdk1.8 version of RPM package: jdk-8u151-linux-x64.rpm
Tar Package Series
Normal User
Root user
Normal User
Installing the JDK environment on Cnetos