For the guide below we want to add an example utility called mytool.exe
which is located in C:\Users\NewFolderInPath\mytool.exe
, so that everytime i want to execute the mytool utility i don't have to specify the full path.
I used this as an example, you can replace the folder with something more realistic like the JDK bin directory located here C:\Program Files\Java\{JDK_VERSION}\bin
to execute javac
, keytool
or everything you want.
Step 1 - Click on the Windows
icon

Step 2 - Click on the Settings
icon

Step 3 - Click on System

Step 4 - Click on About

Step 5 - Click on System info

Step 6 - Click on Advanced system settings

Step 7 - Click on Environment variables...

Step 8 - Select Path
row and then click Edit

Step 9 - Click New
and then click Browse
, then in the next panel which will open you need to select the folder you want in the Path
. For the initial premise of this guide i will add the folder C:\Users\NewFolderInPath

Step 10 - Click OK
and click every OK
button you will encounter to close every previous windows.

Step 11 - Open a command prompt (cmd)
and now you can execute your utility without specifying the full path.

NOTE : For every problems leave a comment below and i will answer as soon as i can.
Good luck and happy coding :)