Set system path variable in Windows

Set system path variable in Windows

When you need to run some application from the Windows terminal, it’s not very often you need to do this but if you’re for example going to run a Java .jar file to start your Minecraft server, it can be convenient to tell Windows where your Java JRE is located and you do not need to reference it by path every time. Setting these system path variables is pretty much the same on all Windows machines and it’s easy if you know where to look. In this tutorial you will learn how to set a system path variable in Windows.

The quick way

Using shortcut key’s are a very convenient way of finding the right stuff quickly, and I’m a big fan of ease of access. We need to go to the System window, use these shortcuts to get there quickly.

[Windows button] + [Pause]

The long way

Sometimes it can be a good idea to also know how to find it the hard way, especially if you forget the shortcut buttons – which is quite normal, since there are so many to keep track of, anyhow. Go to Control Panel -> System and Security -> System

control_panel_system_and_security

When you’ve reached the System window either by using the shortcut or clicking the long way, you’ll see a screen looking something like this image below. As an administrator find and click on the Advanced system settings.

system_window_screen

From the System Properties you’ll need to find and click the Environment Variables button.

system_properties

If you do not have a Path variable as the image shows below, you just need to click the New… and name it Path, and if you do have one just select it and instead click the Edit… button.

environment_variables

Most likely you will already have a path variable and it probably already have a lot of values. As you can see I have a few values in the path variable, these values are separated by a semi-colon “;“. So now let’s say you need to add Java to your path you’ll need to find where you’ve installed your Java, if I was a betting man the path you would need to add would be something like C:\Program Files (x86)\Java\jre7\bin. When you’ve added what was needed, just click your way out of it by clicking OK. And now you can open up your command prompt and use commands like java -version or whatever you need it for.

Jimmy Nelsing's Picture

About Jimmy Nelsing

I'm a computer enthusiast who loves the web and web development, I've used Wordpress for a long time on and off for different web pages for many years. I also like to develop in PHP, especially with Laravel and have also started with Java programming as side projects - testing out Bukkit and Android.

https://jejje.net/

Comments