How to install Oracle JDK with Centos7 source ?, Centos7oracle
How to install Oracle JDK with Centos7 source?
Replace Centos7 with Alibaba Source
Back up
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
Restart the system using yum update
Init 6
Uninstall openjdk and install the jdk of Oracle
1.download jdk-8u161-linux-x64.tar.gz (download from the oracle official website)
2. Use xshell to upload jdk to/usr/local/java in Centos7
Cd/usr/local/mkdir java upload jdk-8u161-linux-x64.tar.gz
3. Uninstall openjdk
[1] Use rpm-qa | grep java to query the system comes with jdk [2] unmount 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 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) run vim/etc/profile and press I to enter the insert mode. Add the environment variable export JAVA_HOME =/usr/local/java/jdk1.8.0 _ 161 export CLASSPATH = to the end of the file.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar export PATH = $ PATH: $ JAVA_HOME/bin 2) Save and exit Mode 1: Press ESC and enter: wq Mode 2: press shift and press Z [5] twice to restart the profile file source/etc/profile [6] To test jdk 1), javac 2), java-version