Saturday, 16 September 2017

How do I append user-defined environment variables to the system variable PATH in Windows 7?


I have two user defined variables:



ANT_HOME set to %USERPROFILE%\Developer\Tools\Apache\Apache Ant\apache-ant-1.8.2 JAVA_HOME set to C:\Program Files\Java\jdk1.6.0_23



And I want append those paths to the System variable so I can access the executables in their bin folders. I tried



PATH set to [other paths];%ANT_HOME%\bin;%JAVA_HOME%\bin



However, that doesn't work. When I open a command-prompt and echo %PATH% the user variables are not expanded. So the path just shows the literal, ;%ANT_HOME%\bin;%JAVA_HOME%\bin


I seem to recall this working fine on my old Windows XP systems. How do I set this up on Windows 7?



Answer



A Microsoft Support article from way back in 2007 — number 329308 — describes a bug in Shell32.dll, which is the cause of this problem. The solution is to add a PATH variable to the user variables list that is set to


%ANT_HOME%\bin;%JAVA_HOME%\bin

This worked around the issue. I don't like setting it for just my user, but somehow my system is presenting symptoms of this old bug and I see no other better answer yet.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...