1. 程式人生 > >centos中,maven環境變數配置以後,重啟後不生效問題

centos中,maven環境變數配置以後,重啟後不生效問題

centos中,maven環境變數配置以後,重啟後不生效問題
一般在/etc/profile裡邊修改,但是這樣只能在當前會話視窗生效,其他人訪問進去之後還是沒有生效
所以這樣  vi ~/.bashrc
export MAVEN_HOME=/usr/local/apache-maven-3.5.0
export PATH=$MAVEN_HOME/bin:$PATH
寫入~/.bashrc裡面,或者在~/.bashrc裡面加一句source /etc/profile
source  ~/.bashrc
這樣就生效了