Install JDK detailed procedure under "Linux" CentOS7

Source: Internet
Author: User

Linux typically installs open JDK, the difference between OPENJDK and JDK: http://www.cnblogs.com/sxdcgaq8080/p/7487369.html

Start the installation steps below:

--------------------------------------------------------------------------the first step-------------------------------------------- ---------------------------

The first step is to unload the system's own openjdk and associated Java files

① in the Command window type:

Java-version

You can see the OPENJDK version information that comes with your system.

② in the Command window type:

Rpm-qa | grep java

Command Description:

RPM Management Suite

-qa use Inquiry mode to query all packages

Grep finds eligible strings in a file

Java finds files that contain Java strings

In the above file:

The following few can be removed

Java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_ 64java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_ 64

Noarch files can not be deleted

Python-javapackages-3.4.1-11.el7.noarchtzdata-java-2016g-2.el7.noarchjavapackages-tools-3.4.1-11.el7.noarch

③ in the Command window type:

RPM-E--nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64

However, there is an error, because under normal user sxd user, there is no permission to manipulate these files.

Solve:

In the Command window, type:

Su Root

Enter the root user, you can have permission to manipulate these files.

Complete the command to delete the file, type in the command window:

Rpm-e--nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64rpm-e--nodeps JAVA-1.8.0-OPENJDK-1.8.0.102-4.B14.EL7.X86_64RPM-E--nodeps java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_ 64RPM-E--nodeps java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64

Command Description:

RPM Management Suite

-e Delete the specified package

--nodeps does not verify the correlation of the suite files

④ Check whether it has been deleted successfully

In the Command window, type:

Java-version

The delegate has been deleted successfully.

⑤ if not removed, remove them with yum-y remove

------------------------------------------------------------------------------the second step---------------------------------------- -------------------------------------

Step two download the latest stable JDK

① for

Install JDK detailed procedure under "Linux" CentOS7

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.