I am having a very weird issue with Windows 7, and I'd like ideas. I appear to be having some sort of sync issue with my environment variables.
So I recently changed from Apache Maven 3.0.5 to 3.0.3 (work required it).
The previous maven folder was located at:
The new one is located in the same place, and 3.0.5 version was deleted:
Maven requires 2 environment variables to be set: a M2_HOME variable, and then an added PATH variable: M2_HOME\bin
I adjusted my M2_HOME variable accordingly, and left the PATH variable alone, since it is just referencing the M2_HOME.
Ok, so when I log into my computer, if I open a command prompt and type:
I get the standard:
'mvn' is not recognized as an internal or external command, operable program or batch file.
If I then type:
It replies with the new correct directory:
If I then check my PATH variable:
It prints (among the rest of the paths) the OLD and non-existent maven folder:
And as if that all wasn't weird enough, to "fix" the problem, all I have to do is go to my environment variables, open the edit for the PATH variable, and then immediately close it without changing or saving anything. After I do that, my echo of the PATH variable is suddenly correct:
And everything works properly.
Another solution is opening up the command prompt in Administrator mode. If I do an echo of the PATH variable then, I get the correct variable:
If I then open the command prompt normally (not in Admin mode), it is still in its "broken" state.
To revert the PATH variable back to its broken state, all I have to do is log out of my account, and then log back in (no need to even turn the pc off, just logging out does it).
Does anyone have a clue what the heck is going on here?