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

Ubuntu14.04 tutorials for installing jdk1.8

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

1. Download jdk download address

I downloaded jdk-8u221-linux-x64.tar.gz.

two。 New folder

Sudo mkdir / usr/local/java

3. Copy the file to the folder you just generated, cp jdk-8u221-linux-x64.tar.gz / usr/local/java4. Go to the java folder and extract the file cd / usr/local/java sudo tar xvf jdk-8u221-linux-x64.tar.gz5. Delete compressed package

Sudo rm jdk-8u221-linux-x64.tar.gz

6. Add environment variabl

Sudo gedit / .bashrc

Add at the end after opening

Export JAVA_HOME=/usr/local/java/jdk1.8.0_221 export JRE_HOME=$ {JAVA_HOME} / jre export CLASSPATH=.:$ {JAVA_HOME} / lib:$ {JRE_HOME} / lib export PATH=$ {JAVA_HOME} / bin:$PATH7. Test whether the installation is successful

Java-version

If there is a mistake

The program 'java' is already included in the following packages:

Default-jregcj-4.8-jre-headlessopenjdk-7-jre-headlessgcj-4.6-jre-headlessopenjdk-6-jre-headless

Please try: sudo apt-get install

Terminal input

Sudo update-alternatives-install / usr/bin/java java/ usr/local/java/jdk1.8.0_221/bin/java 300sudo update-alternatives-install / usr/bin/java java/ usr/local/java/jdk1.8.0_221/bin/javac 300sudo update-alternatives-config java

The terminal inputs java-version again to show that the version is installed successfully.

Summary

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

If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank 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

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report