Tutorial on installing jdk1.8 on ubuntu14.04

Tutorial on installing jdk1.8 on ubuntu14.04

1. Download jdk download address

我下載的是jdk-8u221-linux-x64.tar.gz

2. Create a new folder

sudo mkdir /usr/local/java

3. Copy the file to the folder just generated

cp jdk-8u221-linux-x64.tar.gz /usr/local/java

4. Enter the java folder and unzip the file

cd /usr/local/java
 sudo tar xvf jdk-8u221-linux-x64.tar.gz

5. Delete the compressed package

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

6. Add environment variables

sudo gedit ~/.bashrc

After opening, add at the end

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:$PATH

7. Test whether the installation is successful

java -version

If an error occurs

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

default-jre
gcj-4.8-jre-headless
openjdk-7-jre-headless
gcj-4.6-jre-headless
openjdk-6-jre-headless

Please try: sudo apt-get install <selected packages>

Terminal Input

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

Enter java -version in the terminal again to show that the version has been successfully installed.

Summarize

The above is the tutorial on how to install jdk1.8 on ubuntu14.04 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Use jdk1.8 to implement the operation of grouping the list according to the specified value
  • Java jdk1.8 uses stream to perform list grouping and classification operations
  • ComputeIfAbsent infinite loop bug in ConcurrentHashMap in JDK1.8
  • Let's talk about how the underlying array of ArrayList in jdk1.8 is expanded
  • Graphical tutorial on installing JDK1.8 under CentOS7.4
  • Tutorial on downloading and installing JDK1.8 and configuring environment variables under Windows 10 system
  • Win10 system 64-bit jdk1.8 download and installation tutorial diagram
  • How to install JDK1.8+Tomcat9.0.27+Mysql5.7.28 on Windows
  • CenterOS7 installation and configuration environment jdk1.8 tutorial
  • Configuration of JDK1.8 environment variables under Windows 10 system

<<:  Detailed tutorial on installing mysql-8.0.13 (zip installation) on windows 10 system

>>:  Springboot+VUE to realize login and registration

Recommend

How to introduce Excel table plug-in into Vue

This article shares the specific code of Vue intr...

How to install PHP7.4 and Nginx on Centos

Prepare 1. Download the required installation pac...

Mysql 5.6.37 winx64 installation dual version mysql notes

If MySQL version 5.0 already exists on the machin...

Solution to mysql failure to start due to insufficient disk space in ubuntu

Preface Recently, I added two fields to a table i...

MYSQL transaction tutorial Yii2.0 merchant withdrawal function

Preface I am a PHP programmer who started out as ...

js implements table drag options

This article example shares the specific code of ...

A brief talk about JavaScript Sandbox

Preface: Speaking of sandboxes, our minds may ref...

HTML table markup tutorial (4): border color attribute BORDERCOLOR

To beautify the table, you can set different bord...

Solve the MySQL login 1045 problem under centos

Since the entire application needs to be deployed...

JavaScript to achieve full or reverse selection effect in form

This article shares the specific code of JavaScri...

GZIP compression Tomcat and improve web performance process diagram

1. Introduction I recently worked on a project an...

Sharing several methods to disable page caching

Today, when developing, I encountered a method wh...

How to use http and WebSocket in CocosCreator

Table of contents 1. HttpGET 2. HTTP POST WebSock...

Build a file management system step by step with nginx+FastDFS

Table of contents 1. Introduction to FastDFS 1. I...