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

Detailed Linux installation tutorial

(Win7 system) VMware virtual machine installation...

Why do select @@session.tx_read_only appear in DB in large quantities?

Find the problem When retrieving the top SQL stat...

Management of xinetd-based services installed with RPM packages in Linux

Table of contents Preface 1. Startup management b...

Control the light switch with js

Use js to control the light switch for your refer...

How to configure MySQL8 in Nacos

1. Create the MySQL database nacos_config 2. Sele...

Calendar effect based on jQuery

This article example shares the specific code of ...

How to display div on object without being blocked by object animation

Today I made a menu button. When you move the mous...

Implementation of Docker deployment of web projects

The previous article has installed the docker ser...

JavaScript BOM location object + navigator object + history object

Table of contents 1. Location Object 1. URL 2. Pr...

Security considerations for Windows server management

Web Server 1. The web server turns off unnecessar...

How to hide rar files in pictures

You can save this logo locally as a .rar file and...

MySQL 5.6 binary installation process under Linux

1.1 Download the binary installation package wget...

Integration practice of Vue+Element background management framework

Table of contents Vue+ElementUI background manage...

SQL insert into statement writing method explanation

Method 1: INSERT INTO t1(field1,field2) VALUE(v00...

Axios cancel request and avoid duplicate requests

Table of contents origin status quo Cancel reques...