I had the same issue.
echo %JAVA_HOME%:
C:\Program Files\Java\jdk1.8.0_51
But ant -diagnostics indicated:
java.home : C:\Program Files\Java\jre1.8.0_60
The problem is the JAVA_HOME environment variable is pointing to an invalid directory.
In your case, C:\Program Files\Java\jdk1.7.0_51
does not exist, so Ant goes looking for the folder itself and I guess pulls the JRE folder first.
The problem is that C:\Program Files\Java\jdk1.7.0_51
does not exist, and so ANT resets the java.home variable to first Java directory that it finds:
C:\Programe Files\Java\jre7\
In my case, I had both of these and it still did not find the correct one:
C:\Program Files\Java\jdk1.8.0_60
C:\Program Files\Java\jre1.8.0_60
You probably had updated to a more recently version of the JDK, like
C:\Program Files\Java\jdk1.7.0_79