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 environment variables in Ubuntu system

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article will explain in detail how to install JDK environment variables in the Ubuntu system, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

The specific steps are as follows:

1. First, download jdk and choose the first one. The website is Oracle Jdk. Click in

2. Click Download to download the linux version of jdk on the official website. Choose your corresponding operating system and 32 or 64-bit version. Here I download the 64-bit version of jdk-7u55-linux-x64.tar.gz

3. Create the target path folder of Java, where we put it under usr/lib/jvm. Operate under the terminal:

$sudo mkdir / usr/lib/jvm

Then enter your password to complete the creation.

4. Unzip the jdk file you downloaded to the directory you created, using the following command.

$sudo tar-C / usr/lib/jvm-xzf jdk-7u55-linux-x64.tar.gz

Be careful to put your jdk file under your home page home, and here I put it in the last directory of "download"

5. Check whether the jdk file is installed correctly in the folder you created, and view the file

6. Check to see if java is still available on this machine. The following commands are used here

$sudo update-alternatives-list java

If there is an error in the display figure and there is no java available in the system, we can take the following steps

7. Configure environment variables command:

$sudo gedit ~ / .bashrc

Add the following code:

Export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_55

Export JRE_HOME=$ {JAVA_HOME} / jre

Export CLASSPATH= . : ${JAVA_HOME} / lib:$ {JRE_HOME} / lib

Export PATH=$ {JAVA_HOME} / bin:$PATH

8. Check whether the configuration is successful: java-version

As shown in the picture, the information is configured successfully!

On how to install JDK environment variables in the Ubuntu system to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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