当前位置: 代码迷 >> 综合 >> ubuntu20.04安装jdk1.8
  详细解决方案

ubuntu20.04安装jdk1.8

热度:48   发布时间:2023-10-11 18:13:35.0

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)
ubuntu20.04安装jdk1.8

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

  1. modify
vim /etc/profile
  1. 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
  1. take effect
source /etc/profile
  1. verification
    ubuntu20.04安装jdk1.8