打开/etc/profile的文件,进行编辑
```shell
export JAVA_HOME=/opt/jdk1.8.0_211
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
```
立即生效/etc/profile里的配置 ```json source /etc/profile ``` 标签:profile,JAVA,JDK,PATH,etc,Linux,HOME,安装 From: https://www.cnblogs.com/chaosopen/p/17831193.html