Windows:
After adding or modifying the environment variables in "My Computer"> "properties"> "advanced"> "environment variables", you must restart the system to make them take effect. Is there any way to make it take effect immediately? The following describes a method:
Take the environment variable "path" as an example. After the modification, enter the doscommand prompt and enter: Set Path = C: to close the DOS window. Open the DOS window again and enter echo % PATH %, you can find that the path value set in "My Computer"> "properties"> "advanced"> "environment variable" has taken effect.
Do not worry that changes in the DOS window will affect the value of the environment variable. The environment variable in the DOS window is only a copy of the Windows environment variable. However, modification to the copy will trigger a Windows environment variable refresh, which is exactly what we want!
Linux:
If it is. bash_profile
Source. bash_profile
If you modify the. Profile
Source. Profile
Very simple. Avoid the hassle of restarting.