一、下载安装包
二、解压和查看版本
tar -zxf jdk-8u371-linux-x64.tar.gz -C /usr/local/java/
cd /usr/local/java/jdk1.8.0_371 ./bin/java -version
java version "1.8.0_371" Java(TM) SE Runtime Environment (build 1.8.0_371-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.371-b09, mixed mode)
三、配置环境变量
sudo vim /etc/profile # JDK 8 export JAVA_HOME=/usr/local/java/jdk1.8.0_301 export JRE_HOME=$JAVA_HOME/jre export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
保存并使之生效
:wq source /etc/profile
四、检查
java -version
标签:LTS,bin,java,Java,22.04,export,JDK8,HOME,JAVA From: https://www.cnblogs.com/hunttown/p/17352505.html