CentOS 7 Installation JDK

Source: Internet
Author: User

First, the unloading system comes with the OPENJDK

1, query the system built-in JDK, using the command as follows:

Rpm-qa | grep java

The JDK that exists on the system is listed at this point, and if it exists, it is uninstalled and installed directly.

2. To uninstall, use the following command:

RPM-E--nodeps JDK Related name

After uninstalling the JDK can be installed, the related query and uninstall operations as follows:

Second, JDK installation

1. Download the JDK and upload it to the/usr/java directory.

JDK7: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html Select the corresponding Linux version and download the rpm file. The choice here is jdk-7u79-linux-x64.rpm. and uploaded to the Linux/urs/java directory (created if the Java directory does not exist).

2. Decompression and Installation

Run the following command to unzip

RPM-IVH RPM file name

The associated run results are as shown

3. Configure profile file

Run the following command

Vi/etc/profile

Add the following to the end of the profile file and keep

Export Java_home=/usr/java/jdk1.7.0_79export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _ Home/lib/tools.jarexport path= $PATH: $JAVA _home/bin

/usr/java/jdk1.7.0_79 refers to the path of the JDK.

After saving, run the following command to make the configuration effective

Source/etc/profile

To check if the JDK is installed successfully, run the following command

Java-version

The relevant operation diagram is as follows:

CentOS 7 Installation 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.