Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to uninstall and reinstall jdk with centos7

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how centos7 unloads its own jdk and reinstalls it. It has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.

After installing centos7, I found that it comes with openjdk

[root@centos ~]# java -versionopenjdk version "1.8.0_242"OpenJDK Runtime Environment (build 1.8.0_242-b08)OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

Because the openjdk that comes with it may cause some unnecessary problems, start the following operation

1. uninstall openjdk

Use `rpm -qa| grep jdk`or`rpm -qa| grep java`command query comes with jdk

Use the command `rpm -e --nodeps system comes with the jdk file name` delete the yellow box up four, the other three do not move

2. Install your own JDK.

I use jdk-8u231-linux-x64.tar.gz here

Unzip to the directory you want to install

[root@centos ~]# tar -xf jdk-8u231-linux-x64.tar.gz -C /opt/lft/

Then configure the environment variable vi /etc/profile

export JAVA_HOME=/opt/lft/jdk1.8.0_231/export PATH=$PATH:$JAVA_HOME/bin

Finally, make the configuration work, and then look at the O no OK, and that's it.

[root@centos jdk1.8.0_231]# source /etc/profile[root@centos jdk1.8.0_231]# java -versionjava version "1.8.0_231"Java(TM) SE Runtime Environment (build 1.8.0_231-b11)Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode) Thank you for reading this article carefully. I hope that the article "How to uninstall and reinstall centos7" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support it a lot. Pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report