We earn commission when you buy through affiliate links.
This does not influence our reviews or recommendations.Learn more.
Lets learn how to set up system environment variables in Windows.
What are Environment Variables in Windows?
Imagine an tool that wants to know the path to a specific file on your system.
The program can either go through the entire system and keep searching until it finds the file.
We can categorize environment variables using user dependence as a parameter and term them assystem environment variablesanduser environment variables.
Lets look at all these methods in-depth.
Lets look at how you’re free to enter the GUI from various Windows versions.
tap on the Start Menu and search for environment variables.
The Edit the system environment variables option will appear in the search results.
tap on the same, andWindows 11will display the list of all environment variables.
Go to prefs and enter the About menu.
Now go to Advanced system options.
The System Properties dialogue box should appear on your screen.
hit the Advanced tab and select Environment Variables.
Windows 10 will now display the entire list of user and system variables stored on your machine.
Press Windows +R to explore the Run Window.
Steps to create a new environment variable
pick the New option using the Environment Variables dialogue box.
Now enter the Variable Name and its Value under the respective columns and press OK.
Creating the JAVA_HOME environment variable is a crucial step for installing Java Development Kit.
So, lets create the JAVA_HOME variable and later verify its existence.
tap on the New option and enter JAVA_HOME as the variable name.
Also, enter the installation path for the JDK as the variable value for JAVA_HOME.
Now enter the Variable Name and its Value and press the OK button.
Lets now edit the JAVA_HOME variable that we just created and change its value to another folder.
press the variable and go for the Edit option.
Now enter a different variable value replacing the previous value and click OK.
Here also, you might verify the changed value on the environment variable list.
The updated variable is present on the user variable list.
Steps to Delete environment variables
hit the environment variable you want to Delete.
choose the variable and press Delete and OK subsequently.
The selected variable gets deleted from the list of variables.
The JAVA_HOME variable gets deleted from the list.
Command Prompt Method
you could use the Command Prompt or Windows PowerShell to set up environment variables.
Lets first look at how to use the command prompt method.
Viewing the environment variables
pop kick open the command prompt in Windows.
Now enter set and press Enter.
Creating new environment variables
bring up the command prompt.
[variable_value] stands for the value for the newly created variable.
For example, lets create a TEST_VARIABLE with a value XYZ and then verify its existence using Command Prompt.
We use the following command:
Congratulations!
You just created a new user variable using Command Prompt.
Now, lets verify its existence.
Use the set command to see the list of all the variables.
The variable list returns to its original form once you close a PowerShell session.
Viewing system variables
pop pop the Windows PowerShell.
Windows PowerShell will display the complete list of environment variables.
Lets create another test variable TEST_VARIABLE as an example and then verify its existence.
Conclusion
Creating and tweaking system environment variables is crucial to direct programs and utilize their functionality.
Windows gives you GUI-based and Command Line options to do the same.
The GUI-based methods are simple and easy to follow.
On the other hand, the Command-Line methods are swifter but more complicated.
Now you may check Tuning MySQL system variables for high performance.