linux 配置JAVA环境变量

xiaoxiao2021-02-28  12

1、vi /etc/profile

#set java environment JAVA_HOME=/service/jdk JRE_HOME=$JAVA_HOME/jre CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

立即生效: source /etc/profile

2、vi /etc/bashrc

#set java environment JAVA_HOME=/service/jdk JRE_HOME=$JAVA_HOME/jre CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

立即生效: source /etc/bashrc

3、配置被覆盖或未生效,请参考linux配置文件加载顺序 https://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_linux_010.html https://blog.csdn.net/bjnihao/article/details/51775854

转载请注明原文地址: https://www.6miu.com/read-1650286.html

最新回复(0)