Open the Environment Variables dialog by following these two steps:1) In Windows Start Menu, type "env" then select "Edit the system environment variables"
2) Click the "Environment Variables..." button
You can create System Variables or User Variables using the "New..." button.
You can edit existing variables by selecting one from the list then click the "Edit..." button.
The system variables will be shared for all users, while user variables only affect your account/profile.
Linux/macOS
There are multiple ways to set environment variables depending on the type of shell you are using. To determine the your shell type, use the "echo" command to see the value of the "SHELL" environment variable:
For a tcsh or csh shell, use the following syntax:
for example:
setenv JAVA_HOME /usr/local/
For a bash shell, use the following syntax:
for example:
export JAVA_HOME=/usr/local/
Note that setting an environment variable using these methods on Linux or macOS will only affect the current Terminal session. If you try to open a new shell or start a program outside your original shell the environment variable will not apply.