I configured the environment variables $JAVA_HOME and $M2_HOME the etc/environment file through the root, as follows:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:
JAVA_HOME=/usr/lib/jvm/java-8-oracle/:
CLASSPATH=$JAVA_HOME/lib/:
CLASSPATH:PATH=$JAVA_HOME/bin/:PATH:
$M2_HOME=/usr/share/maven/:
M2=$M2_HOME/bin:
PATH=$M2:$PATH"
broken lines for ease of viewing.
After restart the computer and type the command echo $JAVA_HOME or echo "$JAVA_HOME" displays nothing.
Where am I wrong?
$M2_HOME=...should beM2_HOME=...; yourXXX_HOMEshould not end with:, you have for some reason a"afterPATHand at the last line. Shortly, your structure is completely wrong.JAVA_HOME=/usr/lib/jvm/java-8-oracle/CLASSPATH=$JAVA_HOME/lib/CLASSPATHPATH=$JAVA_HOME/bin/:PATHM2_HOME=/usr/share/maven/M2=$M2_HOME/binPATH=$M2:$PATH