Installing Java under Linux (CentOS and Ubuntu)

Source: Internet
Author: User

In the local test environment to install plug-ins, found that the use of Java, although a programmer, but no use of Java Ah, hey, but the plug-in use Ah, how to do ah? Dress yourself.

One, own system: CentOS 7

1. Check to see if CentOS has its own JDK installed.

Yum List installed |grep Java

Show empty: If there is a JDK that comes with your own installation,

Uninstalling JDK-related file input: yum-y remove java-1.7.0-openjdk*

Uninstall Tzdata-java Input: Yum-y remove Tzdata-java.noarch.

Display: complete! All right, go on,,,,

2. List the Java installation packages in the Yum Library

Yum-y List java*

Show:

3. Install the Java environment using Yum.

Yum-y Install java-1.8.0-openjdk* (I need 1.8.0 or later, so take this as an example)

Display: complete! All right, go on,,,,

4. View the installed Java version

Java-version

Show:

Second, the online system ubuntu16.04

1. Check if Java is installed

Java-version Display: 2, installing the Java 2.1 installation JREsudo apt-get install default-JRE 2.2 Installing OpenJDKsudo apt-get install openjdk-8-jdk   3. Check the Java versionjava -version Show:

Installation is successful!


Installing Java under Linux (CentOS and Ubuntu)

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.