Linux:Ubuntu配置jdk环境变量
#修改文件
vi /etc/environment
#文件尾部添加如下配置
#java
export JAVA_HOME=/usr/local/java/jdk1.8.0_261
export JRE_HOME=/usr/local/java/jdk1.8.0_261/jre
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
#修改文件
vi /etc/profile
#文件尾部添加如下配置
export JAVA_HOME=/usr/local/java/jdk1.8.0_261
export JRE_HOME=/usr/local/java/jdk1.8.0_261/jre
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin
#立即生效
source /etc/profile