ant and java 8 - "major version 52 is newer than 51, the highest major version supported by this compiler"
Please check that the tools.jar used by Ant is from JDK8 and not JDK7.
Window -> Preferences:
In the left pane, go to Ant -> Runtime. In the Classpath tab, check the Global Entries.
This error usually comes when there is difference in the JDK version.Please check classpath, java -version and JAVA_HOME set in the environment variable.