The first chapter deletes the original CentOS openjdk and installs the Sun JDK

Source: Internet
Author: User

First, uninstall the original OPENJDK

    • Rpm-qa | grep java

After that will show up all unloaded and I here is 5

    • RPM-E--nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.2.el7_2.x86_64
    • RPM-E--nodeps java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.2.el7_2.x86_64
    • RPM-E--nodeps Python-javapackages-3.4.1-11.el7.noarch
    • RPM-E--nodeps Javapackages-tools-3.4.1-11.el7.noarch
    • RPM-E--nodeps Tzdata-java-2016h-1.el7.noarch

Finally, by Rpm-qa | grep java to see if there is any content, if not, the instructions are uninstalled cleanly.

Second, install Sun JDK

1. Download the JDK locally from the Oracle website.

2. Upload the locally downloaded JDK to the virtual machine

    • SCP jdk-8u102-linux-x64.tar.gz [Email protected]:/opt/

3. Decompression

    • TAR-XVF jdk-8u102-linux-x64.tar.gz

4. Configure Environment variables

    • Vi/etc/profile
1 java_home=/opt/jdk1.8.0_102 2 Export Java_home 3 Export path= $PATH: $JAVA _home/bin

5. Verification

    • Java-version

The first chapter deletes the original CentOS openjdk and installs the Sun JDK

Related Article

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.