CENTOS7 JDK8 Installation Configuration

Source: Internet
Author: User

First, preparatory work

Uninstall the default installed OPENJDK

1. Find the OpenJDK to uninstall

[Root@localhost ~]$ Rpm-qa | grep OpenJDK | grep-v grep

java-1.7.0-openjdk-1.7.0.75-2.5.4.2.el7_0.x86_64

Java-1.6.0-openjdk-devel-1.6.0.34-1.13.6.1.el7_0.x86_64

2. Uninstall sequentially

Rpm-e–nodeps java-1.7.0-openjdk-1.7.0.75-2.5.4.2.el7_0.x86_64

Rpm-e–nodeps Java-1.6.0-openjdk-devel-1.6.0.34-1.13.6.1.el7_0.x86_64


Note: Insufficient permissions, please use the SU root right to reuse.

Download JDK 8 Click to open link


Second, install the configuration JDK8

1. Extract and install JDK files

TAR-ZXVF jdk-8u60-linux-x64.tar.gz

mkdir/usr/java

mv jdk-8u60-linux-x64  /usr/java/jdk1.8.0_60

2. Configure JDK8

Edit/etc/profile File

Add at end of/etc/profile file

Export java_home=/usr/java/jdk1.8.0_60

export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar:$ Java_home/lib/tools.jar

export path= $PATH: $JAVA _home/bin

Note: The delimiter between paths cannot be used; (semicolon), to use: (colon)

Use the Source/etc/profile command to reload the/etc/profile file so that the modified content takes effect in the current shell window. (permanently in effect, reboot the system or log off the user)

Third, the test is installed successfully

Java-version

java Version "1.8.0_60"
Java (tm) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot (tm) 64-bit Server VM (build 25.60-b23, Mixed mode)

Complete.


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.