ubuntu20.04安装jdk1.8
1. download package
link:https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
choose this (you need login first)
2. move and unzip
mkdir -p /usr/local/programs/java/
mv jdk-8u291-linux-x64.tar.gz /usr/local/programs/java/
tar -zxvf ./jdk-8u291-linux-x64.tar.gz
3. environment configuration
- modify
vim /etc/profile
- append
export JAVA_HOME=/usr/local/programs/java/jdk1.8.0_291
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
- take effect
source /etc/profile
- verification