ubuntu14.04 install jdk1.8 tutorial

1. Download jdk download address##

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

2. new folder##

sudo mkdir /usr/local/java

3. Copy the files to the folder just created##

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 compressed package##

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

6. Add environment variables##

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

7. Test whether the installation is successful##

java -version

If something goes wrong

The program'java' has been 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 package>

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 again in the terminal to display the version installed successfully

to sum up

The above is the tutorial for installing jdk1.8 on ubuntu14.04 introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message, and the editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!

Recommended Posts

ubuntu14.04 install jdk1.8 tutorial
Install JDK10+ on Ubuntu
Install JDK in Ubuntu19.10
5.1. CentOS@ install JDK1.8 graphic tutorial
Minimal install JDK 1.8 tutorial in CentOS 7
CentOS8 install jdk8 / java8 tutorial (recommended)
Install MySQL under Ubuntu 18.04 (graphic tutorial)
Install JDK1.8 original under Ubuntu Kylin
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
CentOS install jdk
ubuntu16.0.1 install pagoda
ubuntu 18.04 install teamviewer
ubuntu install sendmail
Ubuntu20.04 steps to install cuda10.1 (graphic tutorial)
Ubuntu18.04 install Nvidia graphics driver tutorial (graphic)
Ubuntu 18.04 install Odoo14 tutorial through source code
Install apache+PHP under Ubuntu
Ubuntu20.04 install Python3 virtual environment tutorial detailed explanation
install vscode on ubuntu18
Install node.js under Ubuntu
Windows10 install ubuntu20.04 dual system detailed graphic tutorial
ubuntu install zsh terminal
Install JDK and configure environment variables on Ubuntu 16.04
Install nvtop on Ubuntu 18.04
Install postgresql-10 on Ubuntu 18.04
Install python3.6 under Ubuntu 16.04
Install docker on Ubuntu
Install mysql under Ubuntu 16.04
Install Thrift under ubuntu 14.10
Centos install elasticsearch tutorial
Install OpenJDK10 under Ubuntu
Install Caffe under Ubuntu 14.04
Install nodejs10 on Ubuntu16
ubuntu install harbor warehouse
Install mysql on Ubuntu 14.04
Linux Centos7 install jdk1.8
Install Pytorch+CUDA on Ubuntu 16.04
Centos7 install kubernetes tutorial
Centos7 install Mysql8 tutorial
Install Python3 on Ubuntu 14.04
Ubuntu18.04 install Asterisk16.10 + FreePBX15.0
Ubuntu19 install MySQL pit
ubuntu16.04 install node.js, npm
Install rJava on Ubuntu18
CentOS7 install JDK8, tomcat8
pcduino ubuntu install os
Install python in Ubuntu
Install Python3 on Ubuntu 16.04
Install ROS under ROS Ubuntu 18.04[2]
Install MySQL under Ubuntu
Install KDE on Ubuntu16.04.2
ubuntu install nginx server
Install Yarm-PM2 under Ubuntu
Install Docker on Ubuntu18