下载 Java
官网
https://www.oracle.com/java/technologies/downloads/https://www.oracle.com/cn/java/technologies/downloads/
国内镜像
http://www.codebaoku.com/jdk/jdk-index.html
变量环境
普通用户
sudo vim ~/.bashrc
# 下面的添加到bashrc文件的末尾添加
# java环境
export JAVA_HOME=//usr/lib/jvm/jdk-19
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$JAVA_HOME/lib
超级用户
sudo vim /etc/profile
# 下面的添加到profile文件的末尾添加
# java 环境
export JAVA_HOME=//usr/lib/jvm/jdk-19
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$JAVA_HOME/lib
sudo vim /root/.bashrc
# 在文件的末尾添加
source /etc/profile
配置生效
source ~/.bashrc
source /root/.bashrc
标签:Java,jdk,java,bashrc,export,Ubuntu,HOME,安装,JAVA
From: https://www.cnblogs.com/Ahtelek/p/ubuntu-install-java.html