I just changed my /etc/environment
file to:
M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1
M2=$M2_HOME/bin
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
PATH=$M2:$PATH
JAVA_HOME=/usr/local/jdk1.6.0_45
PATH=$JAVA_HOME:$PATH
(trying to do something similar to this)
However, when I tried checking the environment variables by typing, for instance echo "$M2"
, the result is an empty line for all the variables and $PATH is the same as before editing the file. Why didn't my changes operate? I tried closing and opening the shell, but nothing happens.
/etc/environment
where it is located by default. Otherwise I agree. – Gunnar Hjalmarsson Aug 30 '14 at 10:22