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 `JAVA_HOME` variable.
On Mac OSX
1. Open
.bash_profile or .zshrc by vivi ~/.zshrc # or vi ~/.bash_profile
bash
2. Add
JAVA_HOME variable like thisexport JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_281.jdk/Contents/Home
3. Run
source command to donesource ~/.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 Variablesbutton and we getEnvironemment Variablespopup:

- In
System variablessection, click toNew...button and we have:

- Click
OKbutton onNew System Variablepopup and remain popup and done.