Install JDK in Ubuntu19.10

Installation environment: ubuntu19.10
JDK version: JDK8
Host: Windows10

This article applies to all Linux systems to install JDK.

Be sure to pay attention to whether the computer is 32-bit or 64-bit, and install the corresponding JDK! ! !


One, get the installation package##

First, you need to obtain the JDK installation package, there are two ways:

Second, upload to the server##

Then upload it to the server. If you are using a virtual machine, it is more convenient. If not, please use a tool to transfer. It is recommended to use a remote connection tool, which is Xftp6.

After the installation is complete, as shown in the figure:

Then drag the file to the server. Please pay attention to my path here. I chose the /usr/local/src directory. The tools we use for development are best placed in this folder without affecting system operation. It's just like the document folder in win, and then we selected the project, then create a new folder, and enter the following commands in turn:

cd /usr/local/src
sudo mkdir java
chmod 777/usr/local/src/java

So we have created a folder and modified its permissions so that anyone can read and write:

Next, drag our tar.gz file to this folder. This will take a while:

Three, unzip and install##

Enter the directory:

cd /usr/local/src/java
tar -zxvf jdk-8u221-linux-i586.tar.gz

Take a look after decompression:

Configure environment variables:

sudo vi /etc/profile

Append the following at the end of the file:

# set java environment
export JAVA_HOME=/usr/local/src/java/jdk1.8.0_221 ##Note here that the directory should be replaced with the jdk directory that you decompressed
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

Make the environment variable take effect immediately:

source /etc/profile

Check the java version to see if the installation is successful:

java -version

Fourth, the problems encountered##

I encountered a problem, but I already pointed it out at the beginning of the article. It is the problem of the number of computers. Before I installed a 32-bit JDK on a 64-bit computer, the error was as follows:

bash:/usr/local/src/java/jdk1.8.0_221/bin/java:No such file or directory

solution:

sudo apt install lib32z1

Just install 32-bit dependencies.

Recommended Posts

Install JDK in Ubuntu19.10
Install mysql-pytho in Ubuntu
Install JDK10+ on Ubuntu
Install python in Ubuntu
ubuntu14.04 install jdk1.8 tutorial
Install VMware Tools in Ubuntu 18.04
How to install Helm in Ubuntu
Install JDK8 in rpm on CentOS7
Minimal install JDK 1.8 tutorial in CentOS 7
How to install mysql in Ubuntu 14.04
Install and configure Docker in Ubuntu
Install JDK1.8 original under Ubuntu Kylin
How to install mysql in Ubuntu 14.04
ubuntu18.04 install python2
ubuntu18.04 install docker
ubuntu12.04 install python3
Ubuntu install guide
ubuntu install nodejs
ubuntu 16 install asp.net
ubuntu install leanote
ubuntu install Jenkins
docker install ubuntu
ubuntu install elasticsearch
CentOS install jdk
ubuntu16.0.1 install pagoda
ubuntu18.04 install python
ubuntu 18.04 install teamviewer
ubuntu install sendmail
How to install cuda10.1 driver in Ubuntu
How to install ROS Noetic in Ubuntu20.04
Install Ubuntu 18.04 in the virtual machine VMware
Install jetty in Ubuntu 18.04 Server, non-apt version
Install gsl package in R language on ubuntu
Install apache+PHP under Ubuntu
install vscode on ubuntu18
Install node.js under Ubuntu
Nagios3 in ubuntu serve
ubuntu install zsh terminal
Install JDK and configure environment variables on Ubuntu 16.04
Install Redis on Ubuntu
Install R4 on ubuntu20
Install nvtop on Ubuntu 18.04
Install python3.6 under Ubuntu 16.04
Install docker on Ubuntu
Install MySQL5.7 in centos7
Install php in centos
Ubuntu18.04 install opencv 3.2.0 solution
Install mysql under Ubuntu 16.04
Install Thrift under ubuntu 14.10
Install OpenJDK10 under Ubuntu
Install Docker on ubuntu18.04
Install nodejs10 on Ubuntu16
How to install python in ubuntu server environment
ubuntu install harbor warehouse
Install mysql on Ubuntu 14.04
Ubuntu16.04 install Mongodb tutorial
Install Django on ubuntu
Linux Centos7 install jdk1.8
Install Pytorch+CUDA on Ubuntu 16.04
2018-09-11 Install arduino under Ubuntu
Install Python3 environment in a brand new Ubuntu