Install CENTOS7 64-bit Operating system (abbreviated)
Note: I installed the server with the GUI when I chose, and I checked the development tools option Replace Centos7 original source for Ali first backup
cd/etc/yum.repos.d/
MV centos-base.repo/etc/yum.repos.d/centos-base.repo.backup Download Ali source Repo file
wget Http://mirrors.aliyun.com/repo/Centos-7.repo Insert Code
MV Centos-7.repo Centos-base.repo Update system
Yum Clean All
Yum Makecache
Yum Update reboot System
Init 6 Uninstall OPENJDK, install Oracle JDK
1. Download jdk-8u161-linux-x64.tar.gz (Oracle website download)
2. Upload jdk to Centos7/usr/local/java using Xshell
cd/usr/local/
mkdir java
upload jdk-8u161-linux-x64.tar.gz
3. Uninstall OPENJDK
[1] Using Rpm-qa | grep Java Query System with JDK
[2] Uninstall non-noarch file
1), rpm-e--nodeps java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64
2) , rpm-e--nodeps java-1.8.0-openjdk-headless-1.8.0.131-11.b12.el7.x86_64
[3]rpm-qa | grep java command to query whether to delete
4. Install the Sun's JDK
[1]cd/usr/local/java/
[2]tar xvf jdk-8u161-linux-x64.tar.gz
[3]rm-f jdk-8u161-linux-x64.tar.gz
[4] Edit/ Content in Etc/profile
1), vim/etc/profile after I enter insert mode, add environment variables at the end of the file
export java_home=/usr/local/java/jdk1.8.0 _161
export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
export path= $PATH: $JAVA _home/ Bin
2), save and exit
mode one: Press the ESC key and then enter: Wq
mode two: Hold down the SHIFT key and double-click two times Z
[5] To restart profile
Source/etc/profile
[6] test JDK
1), Javac
2), java-version