Why does every entry command have to be re-source/etc/profile to take effect?

  linux, question
# edit JDK8
 export JAVA_HOME="/usr/java/java8"
 
 # Edit maven
 export M2_HOME="/opt/idea-IU-162.1121.32/plugins/maven/lib/maven3"
 
 # edit PATH
 export PATH="$JAVA_HOME/bin:$M2_HOME/bin:$PATH"

This is the configuration at the end of my /etc/profile. JDK has no problem. it can come out without source and echo $JAVA_HOME. the problem is that if you want to use mvn, you have to source it once at a time. maven is what IDEA comes with.

It can also be placed in ~/.bashrc. Or add a source /etc/profile to ~/.bashrc.