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

The method of configuring jdk Environment under Linux

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

1. Go to the official website to download jdk packages for linux, such as jdk-8u162-linux-x64.tar.gz

two。 Create a directory and copy the jdk package to that directory, such as home//user/java

3. Enter the directory in the console and execute tar zxvf jdk-8u162-linux-x64.tar.gz to extract it.

4. Configure environment variables:

Open the console, run sudo vi / etc/profile, insert the following configuration into the file, and then save the exit (press esc, then: wq)

JAVA_HOME=/home//user/java/jdk1.8.0_162 PATH=$JAVA_HOME/bin:$PATH CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export JAVA_HOME export PATH export CLASSPATH

5. Run source / etc/profile to make the environment work

6. Type java-version in the terminal to see if it is successful (that is, the corresponding version number appears).

Summary

The above is the editor introduced to you under the Linux configuration jdk environment, I hope to help you, if you have any questions welcome to leave me a message, the editor will reply to you in time!

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

Servers

Wechat

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

12
Report