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 install jdk under Linux

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

Share

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

This article introduces the knowledge of "how to install jdk under Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Install JDK 1 under Linux, download jdkwget-- no-check-certificate-- no-cookies-- header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz II, decompress

When unzipped with the tar command, a jdk1.8.0_131 directory is generated

Rename jdk1.8.0_131 to jdk1.8 in order to make it easier to use mv

Move jdk1.8 to the / usr/local directory (of course, you can also move it to another directory, and then change the configuration environment variable to your own jdk path)

Tar-zxvf jdk-8u131-linux-x64.tar.gzmv jdk1.8.0_131 jdk1.8mv jdk1.8 / usr/local III. Configure environment variables

1. Modify / etc/profile file

Vi / etc/profile

Configure the jdk environment at the end of the profile file:

Export JAVA_HOME=/usr/local/jdk1.8export JRE_HOME=$ {JAVA_HOME} / jreexport CLASSPATH=.:$ {JAVA_HOME} / lib:$ {JRE_HOME} / lib:$CLASSPATHexport JAVA_PATH=$ {JAVA_HOME} / bin:$ {JRE_HOME} / binexport PATH=$PATH:$ {JAVA_PATH}

2. Make profile effective

Source / etc/profie IV. Check whether the configuration environment is successful

Java-version command to view the jdk version

Java-version

If the version is displayed, the environment is configured successfully; if the prompt command cannot be found, the configuration environment fails, possibly due to an error in the profile path.

This is the end of "how to install jdk under Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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