In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces you how to configure Java environment in Linux, the content is very detailed, interested friends can refer to it, I hope it can help you.
Download JDK
First log on to JDK official website and select the JDK version you want. Here we use JDK 8:
Click JDK Download and select the download format:
Select the Linux-x64 archive here and click Download.
install the JDK
Once the download is complete, move the JDK package to a directory in Linux.
On Linux systems, we install our own software in either/usr/local or/usr/lib. But this is not mandatory, installation in other is also possible, but in the configuration of some environment variables, be sure to write the path correctly.
Here, I installed it in/usr/local/java directory:
Then cd to that directory and extract the file: tar -zxvf jdk-8u241-linux-x64.tar.gz
After waiting for the decompression to complete, a jdk folder will be generated under the sibling directory:
At this point, JDK has been successfully installed.
Configuring Java Environment Variables
After installing JDK, you need to configure environment variables. Edit the/etc/profile file:
To configure Java environment variables, place the following four lines of code at the end of this file: Note your JDK version number:
export JAVA_HOME=/usr/lib/jdk1.8.0_241
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:$ {JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
When the modification is complete, save and exit. Then execute the source /etc/profile command to make the configuration take effect.
Then you can view java version information with java -version command:
About how to configure Java environment in Linux to share here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.