There are 2 ways to edit or set environmental or system variable on windows machines:
Method 1 –
In Windows 7 OS
Then,
When we update existing variables, then we need to append value instead of overwriting existing value, better to add “;” at the end and append the value.
Method 2 –
Through command prompt,
To update user variable, search for command prompt and right click “Run as administrator”
setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0"
setx PATH "%PATH%;%JAVA_HOME%\bin";
To update under system variable section, you need to have administrator privileges.
setx -m JAVA_HOME "C:\Program Files\Java\jdk1.8.0"
setx -m PATH "%PATH%;%JAVA_HOME%\bin";
NOTE:
User variables are for the current user logged into the machine.
System variables are shared to all users
1 Comment