Thursday, September 20, 2018

Why can't Windows handle an environment variable in Path?

My colleague and I have identical Dell workstations with Windows XP Professional x64 edition installed.


My Path environment variable starts with:


%JAVA_HOME%\bin;...

My colleague's Path variable includes the same directory, specified using the same environment variable, but it is not the first item in his Path.


If I access system properties -> environment variables and change the value of my JAVA_HOME variable, the version of java found from the command-line changes as I expect. This is starting a brand new console window, to be sure to pick up the changes.


But on my colleague's machine, it does not. He continues to find his previous version of Java until he brings up his Path variable and saves it (even if he makes no changes to it). (Again, this is when starting a brand new console window.)


I have been observing this inconsistency on Windows for about 6 months now and very curious about it. We have way too many versions of Windows in our office, so rarely have I had a chance to see this happening on two machines running the exact same OS version, until now.


What is causing this? Why does his machine not re-evaluate Path, using the new JAVA_HOME, when mine does?


(Is it because it's not the first thing in the Path? If so, how could that be, and why? I'd do more tests to check, but I think he's now fed up with it and would like to get back to work.)

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...