How to install Oracle JDK with Centos7 source ?, Centos7oracle

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.