First, preparatory work
Uninstall the default installed OPENJDK
1. Find the OpenJDK to uninstall
[Root@localhost ~]$ Rpm-qa | grep OpenJDK | grep-v grep
java-1.7.0-openjdk-1.7.0.75-2.5.4.2.el7_0.x86_64
Java-1.6.0-openjdk-devel-1.6.0.34-1.13.6.1.el7_0.x86_64
2. Uninstall sequentially
Rpm-e–nodeps java-1.7.0-openjdk-1.7.0.75-2.5.4.2.el7_0.x86_64
Rpm-e–nodeps Java-1.6.0-openjdk-devel-1.6.0.34-1.13.6.1.el7_0.x86_64
Note: Insufficient permissions, please use the SU root right to reuse.
Download JDK 8 Click to open link
Second, install the configuration JDK8
1. Extract and install JDK files
TAR-ZXVF jdk-8u60-linux-x64.tar.gz
mkdir/usr/java
mv jdk-8u60-linux-x64 /usr/java/jdk1.8.0_60
2. Configure JDK8
Edit/etc/profile File
Add at end of/etc/profile file
Export java_home=/usr/java/jdk1.8.0_60
export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar:$ Java_home/lib/tools.jar
export path= $PATH: $JAVA _home/bin
Note: The delimiter between paths cannot be used; (semicolon), to use: (colon)
Use the Source/etc/profile command to reload the/etc/profile file so that the modified content takes effect in the current shell window. (permanently in effect, reboot the system or log off the user)
Third, the test is installed successfully
Java-version
java Version "1.8.0_60"
Java (tm) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot (tm) 64-bit Server VM (build 25.60-b23, Mixed mode)
Complete.