Notice: This post is more than a year old. It may be outdated.
Recently, working on a Windows box, I had a problem where my
ant -version result did not match.
Problem resided in the order of path variables.
ANT_HOME was declared last but when the system looks for a command in the path, it uses the first result it finds.
For example, the following was in my path:
- C:\Program Files (x86)\Subversion\bin;
- C:\Program Files\TortoiseHg\;
- C:\Program Files (x86)\Git\bin;
As it can be seen,
apache-ant-1.9.0 is almost the last one in the list. Little did I know that Weblogic folder contanied an older version of
ant as well. I reordered my path, and everything worked like a charm afterwards.
The same thing can happen with Java. You have your
JAVA_HOME set, but for some reason
java -version returns a different version number. Check
windows\system32\ folder, because
java.exe might exist there as well. Add your Java location before
windows\ path declarations.