Windows PATH Variable Explained
What the Windows PATH variable does, how to view and edit it on Windows 10 & 11, and the most common mistakes that cause 'command not found' errors.
Everything you need to know about the PATH environment variable on Windows — what it does, how to edit it, and why developer tools like Java, Node.js, and Python depend on it.
What Is the PATH Variable?
The PATH is a system environment variable that tells Windows where to look for executable programs. When you type a command like java --version in a terminal, Windows searches through every directory listed in PATH until it finds a matching file.
'java' is not recognized as an internal or external command...
How to Edit PATH (Windows 11)
- Search for "Environment Variables" in the Start menu.
- Click "Edit the system environment variables".
- Click "Environment Variables…" at the bottom.
- Select Path under System Variables and click Edit.
- Add your new directory path and click OK.
Common Mistakes
- Adding the file, not the folder:Always add the
\bindirectory, not the.exefile itself. - Not restarting the terminal:Changes only apply to new terminal windows.