Setting environment variables in Windows is a very easy thing to do. For example with. Just right click on the environment variable of the advanced system settings----My Computer, select Path, then tap "Edit" to enter the content you want to join.
The ability to add some command-line commands that you want to execute directly.
Java, for example, is going to get the bin folder under the JDK and so on.
However. It's not that simple in Linux.
Take Ubuntu for example. Environment variables are set up in two ways, one of which is
Open the terminal via Ctrl+alt+t and enter:
sudo gedit/etc/environment
After entering password, open the configuration file for the system variable. Then change the content inside.
System environment variables. Join directly at the end
: The path you want to set.
Use the colon: Cut directory.
After saving exit, pass in terminal.
Source/etc/environment
Make it effective.
This command has the same ability to restore errors such as sudo and other intrinsic commands. When you enter sudo, the "xx is not in the PATH environment variable, so cannot find the command" prompt, assuming that your/ext/environment has not been changed, can be repaired by the command.
It is only generally not advisable to do so. Assuming that the change is wrong, the entire Ubuntu intrinsic command sudo will not work.
The user environment variable is usually set in the terminal via:
Gedit ~/.BASHRC
Open the User environment variable configuration file, which can be opened without the sudo command, because it is a user environment variable,
Turn to the end, and fill in a sentence:
Export path=xx: $PATH, where xx is the path you set. The following: $PATH is indispensable.
Without formatting, the same can cause intrinsic commands such as sudo,apt-get to not run.
For example, the android ADB command is configured in the user's environment variable.
After. Save exit. In Terminal input:
SOURCE ~/.BASHRC
is in effect.
"Linux" Environment variable settings