Add Environment Variables
Updated at 1699804401000An Environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. Let's say now we need a
ash
JAVA_HOME
variable.On Mac OSX
1. Open .bash_profile
or .zshrc
by vi
vi ~/.zshrc # or vi ~/.bash_profile
2. Add JAVA_HOME
variable like this
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_281.jdk/Contents/Home
3. Run source
command to done
source ~/.zshrc # or source ~/.bash_profile
On Windows 10
1. In Search
, search for and then select: System (Control Panel
) and we get:
2. Click the Edit the system environment variables
link and we get:
- Click to
Environment Variables
button and we getEnvironemment Variables
popup:
- In
System variables
section, click toNew...
button and we have:
- Click
OK
button onNew System Variable
popup and remain popup and done.