How to install jdk in CentOS7

angryTom
Release: 2020-03-17 10:01:27
Original
6090 people have browsed it

How to install jdk in CentOS7

How to install jdk in CentOS7

1. Before installation, check whether the system comes with open-jdk

Command:

rpm -qa |grep java
rpm -qa |grep jdk
rpm -qa |grep gcj
Copy after login

If no information is entered, it means there is no installation. If installed, you can use rpm -qa | grep java | xargs rpm -e --nodeps to batch uninstall all files with Java. The keyword of this command is java.

Recommended learning: thinkphp tutorial

2. Then retrieve the list containing java

yum list java*
Copy after login

How to install jdk in CentOS7

3. Select the jdk version you need to install. For example, to install 1.8 here, execute the following command:

yum install -y java-1.8.0-openjdk-devel.x86_64
Copy after login

Wait until the installation is completed.

4. After the installation is complete, check the installed jdk version and enter the following command:

java -version
Copy after login

Here you can see the jdk version information you installed. .

How to install jdk in CentOS7

The jdk installed in this way will be installed under the usr/lib/jvm directory

This article comes from PHP Chinese Net, CentOS usage tutorial column, please pay attention to this column for more related tutorials!

The above is the detailed content of How to install jdk in CentOS7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template