Replace CENTOS7 source Installation oraclejdk__oracle

Source: Internet
Author: User
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

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.