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 installing jdk1.8 in centOS7

2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

1. Create a new Java folder under the / usr/local directory

Mkdir / usr/local/java

Copy the jdk to / usr/local/java, enter the java folder, and extract the package

Tar xvf jdk-8u181-linux-x64.tar.gz

2. Setting environment variables here uses the global setting method, that is, modify etc/profile, which is a common environment variable for all users to find / etc/profile, edit, and add at the end.

Export JAVA_HOME=/usr/local/java/jdk1.8.0_181export JRE_HOME=/usr/local/java/jdk1.8.0_181/jreexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATHexport PATH=$JAVA_HOME/bin:$PATH

In the above process of adding, do not add spaces on both sides of the equal sign, otherwise "is not a valid identifier" will appear, because the source / etc/profile cannot recognize extra spaces, which will be understood as part of the path.

And save it.

Run the following command to make profile effective.

Source / etc/profile

3. Verify whether the terminal is successful or not.

Java-versionjavac

Summary

The above is the method of installing jdk1.8 in centOS7 introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave a message for me, and the editor will reply you in time. Thank you very much for your support to the website!

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