After trying out all the above I was still having the same issue.
Then I tried the following,
Open a command prompt and typed java -version. It showed me a JRE version 1.8.
Open a command prompt and went to location of the JDK 1.7 bin directory and typed java -version. This time it showed correctly 1.7.
Then after digging at few places I found that apart from the above locations there are additional locations for Java runtime.
Registry
There is also a registry key where JRE location are specified under
HKLM\Software\Javasoft\Version
I changed the entries here to point to the JDK 1.7
ProgramData
The directory "C:\ProgramData\Oracle\Java\javapath" is present in PATH environment variable and contains shortcuts to the java, javaw etc... The target for these shortcuts were all JRE 1.8. (This I think was the main problem) I changed the shortcuts to point to the correct JDK exe's.
Once all of this was done. I opened eclipse all the jdk.tools pom.xml errors disappeared.