I'm trying to transfer my end of environment variables .bashrc file to the end of the /etc/environment file.
But every time I change this file can not login on the computer and to undo the changes through the display mode CTRL+ALT+F2, then to save time, I wonder if my configuration is correct before restarting my computer .
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"
I made the changes as root, it is correct the way edited /etc/environment the file?
/etc/environment - This file is specifically meant for system-wide environment variable settings. It is not a script file, but rather consists of assignment expressions, one per line. Specifically, this file stores the system-wide locale and path settings.
You cannot reference previously defined variables in the same way as you would do in .bashrc in the /etc/environment. See this section of the Ubuntu Community Help wiki,
"It is not a script file, but rather consists of assignment expressions, one per line."
Also have a look at the following answer regarding syntax examples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With