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

Steps for centos to install jdk

2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains the "steps to install jdk in centos". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn the steps of installing jdk in centos.

Goal: install jdk into the usr/java/jdk directory

1. Download jdk

I went to window to download the jdk installation package on the jdk official website, and I downloaded it: jdk-8u221-linux-x64.tar.gz. Originally, it can be downloaded through the wget jdk address in centos, but my download is too slow. I can only download it in windows, and then upload it to centos by rz command. The directory is as follows

[root@43-c59438365-0048-0727982 jdk] # pwd

/ usr/java/jdk

[root@43-c59438365-0048-0727982 jdk] # ll

Total 190716

-rw-r--r-- 1 root root 195094741 Jul 23 17:50 jdk-8u221-linux-x64.tar.gz

[root@43-c59438365-0048-0727982 jdk] #

two。 Decompress jdk

[root@43-c59438365-0048-0727982 jdk] # tar-zxvf jdk-8u171-linux-x64.tar.gz

[root@43-c59438365-0048-0727982 jdk] # ll

Total 190720

Drwxr-xr-x 7 10 143 4096 Jul 4 19:37 jdk1.8.0_221

-rw-r--r-- 1 root root 195094741 Jul 23 17:50 jdk-8u221-linux-x64.tar.gz

[root@43-c59438365-0048-0727982 jdk] # cd jdk1.8.0_221/

[root@43-c59438365-0048-0727982 jdk1.8.0_221] # pwd

/ usr/java/jdk/jdk1.8.0_221

3. Configure jdk environment variables

[root@43-c59438365-0048-0727982 jdk1.8.0_221] # cd / etc

[root@43-c59438365-0048-0727982 etc] # vi profile

Add the following configuration at the end

Unset i

Unset-f pathmunge

#) jdk environment variable configuration

JAVA_HOME=/usr/java/jdk/jdk1.8.0_221

CLASSPATH=.:$JAVA_HOME/lib.tools.jar

PATH=$JAVA_HOME/bin:$PATH

Export JAVA_HOME CLASSPATH PATH

#)

TMOUT=1800

Readonly TMOUT

Export TMOUT

4. Save exit and view jdk version information

[root@43-c59438365-0048-0727982 etc] # java-version

Java version "1.8.0,221"

Java (TM) SE Runtime Environment (build 1.8.0_221-b11)

Java HotSpot (TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

[root@43-c59438365-0048-0727982 etc] #

It's over.

Thank you for your reading, the above is the "centos installation of jdk steps" content, after the study of this article, I believe you have a deeper understanding of the steps of centos installation of jdk, the specific use of the need for you to practice and verify. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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