3

I'm learning java, and had the jdk set as part of the Path system variable. When following a guide on how to install Maven, I created a PATH variable and set again the jdk to the PATH variable.

The result was that the Path variable was deleted from the system (Windows 10). In addition, the jdk and jre were also deleted from the location where they were installed (C:\Program Files\Java). I reinstalled the jdk and jre, and defined a new PATH variable. for now, I can run java and eclipse, and did not experience any issues.

My questions:

  1. Is there any difference between PATH and Path?
  2. Path variable had many programs set to it (I don't remember which programs). Now that it no longer exists, what would be the implications?
  3. What could be the reason that Path variable was deleted?

Thanks, Oren

Rafael Odon
  • 1,211
  • 14
  • 20
oren kostin
  • 169
  • 3
  • 7

1 Answers1

10

1) PATH and Path are the same since Windows environment variables are case insensitive (File paths in Windows environment not case sensitive?).

2) Windows use Path to locate executables that are not located in the "current folder". For instance, when you type "java.exe" on the command line, Windows will first try to find a local executable file with this name on the directory path you are at. If it can't find it there, Windows will then look for this file in another places. At some point of this search it will look for the file inside every directory entry of Path variable, from the first to the last. That's why Path is a list of paths where order matters.

If you have removed or empty the Path variable, maybe there will be some side effect over some previously third party installed program, since it's executables won't be found outside their installation folder.

3) Problably you deleted it by accident when trying to set up the Java environment. It's difficult to guess...

Rafael Odon
  • 1,211
  • 14
  • 20