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 and configure jdk-11.0.2 in Ubuntu18.04

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article introduces the relevant knowledge of "how to install and configure jdk-11.0.2 in Ubuntu18.04". 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!

SUN company released the latest version of jdk-11.0.2 decompressed only jdk this folder, and there is no corresponding folder for the previous jre. I don't know exactly where the jre is. But the steps are obviously easier to install and configure environment variables.

1) Uninstall the OpenJDK that comes with Ubuntu:

Enter: sudo apt-get remove openjdk* on Terminal

2) download the latest JDK version: jdk-11.0.2 on the official website of SUN

After decompressing, put it in the directory you want, and only jdk is the folder after decompression.

III) configure environment variables

1) enter: sudo gedit / etc/profile in Terminal to open the system file

2) add two lines at the end of the file

Export JAVA_HOME=/home/peng/java/jdk-11.0.2_linux-x64_bin/jdk-11.0.2 # is followed by the address where you store it.

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

one

two

3) after saving the file and exiting, enter: source / etc/profile on the Terminal to make the execution effective

IV) check the installation and configuration version

Enter java-version or javac-version on Terminal

If the following results appear, the installation and configuration is successful.

Supplementary note:

There is a problem here, that is, you have to type source / etc/profile on the terminal every time for profile to take effect, which is troublesome.

There is a solution:

1) Open the terminal and enter: vim ~ / .bashrc

II) add a line source / etc/profile at the end to save and exit (press Esc and: wq)

3) finally, enter: source ~ / .bashrc at the terminal

If you open the terminal again, you will find that you can use java directly.

This is the end of the content of "how to install and configure jdk-11.0.2 for Ubuntu18.04". 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