Introduction to installing JDK under Linux, including uninstalling OpenJDK

Introduction to installing JDK under Linux, including uninstalling OpenJDK

1. View openjdk

rpm -qa|grep jdk 

2. Delete openjdk (rpm -e --nodeps)

rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.262.b10-1.el7.x86_64

3. Check whether openjdk has been deleted (same as checking jdk)

rpm -qa|grep jdk

4. Create a java directory under usr, import the installation package into the directory and decompress the files

5. Enter the vim /etc/profile directory and edit the configuration file

export JAVA_HOME=/usr/java/jdk1.8.0_181

6. Make the file effective

source /etc/profile 

7. Check whether jdk is installed

 java -version 

8. Copy the configuration file to other virtual machines (scp -r /etc/profile root@z3:/etc/profile
) Change the blue area to the name of your virtual machine

scp -r /etc/profile root@z3:/etc/profile 

9. Copy the installation package to another virtual machine (scp -r /usr/java root@z3:/usr/java
)Blue font same as above

 scp -r /usr/java root@z3:/usr/java 

10. Use vim /etc/profile on other virtual machines to make the file effective

vim /etc/profile

This is the end of this article about installing jdk under Linux, including uninstalling OpenJDK. For more information about installing jdk under Linux and uninstalling OpenJDK, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to uninstall Linux's native openjdk and install sun jdk

<<:  A brief analysis of the underlying principles of MySQL transactions and isolation levels

>>:  CSS implements five common 2D transformations

Recommend

Detailed explanation of docker version es, milvus, minio startup commands

1. es startup command: docker run -itd -e TAKE_FI...

Specific usage of Vue's new toy VueUse

Table of contents Preface What is VueUse Easy to ...

The difference and execution method of select count() and select count(1)

Count(*) or Count(1) or Count([column]) are perha...

Detailed explanation of WeChat Mini Program official face verification

The mini program collected user personal informat...

Compile CPP files using G++ in Ubuntu

When I used g++ to compile the cpp file for the f...

5 MySQL GUI tools recommended to help you with database management

There are many database management tools for MySQ...

The difference between MySQL execute, executeUpdate and executeQuery

The differences among execute, executeUpdate, and...

Solve the problem of mysql's int primary key self-increment

Introduction When we use the MySQL database, we a...

How to change apt-get source in Ubuntu 18.04

When using apt-get to install, it will be very sl...

MySQL 5.7 zip archive version installation tutorial

This article shares the installation tutorial of ...

One-click installation of MySQL 5.7 and password policy modification method

1. One-click installation of Mysql script [root@u...

HTML table markup tutorial (15): table title

<br />This tag can be used to directly add a...

Solution to uninstalling Python and yum in CentOs system

Background of the accident: A few days ago, due t...