I downloaded the latest release of Eclipse (Mars) and changed the required Java version to 1.6 in eclipse.ini file as my project uses Java 1.6.
I configured installe
I faced the same problem after upgrading to Eclipse Mars.
I solved this by changing the runtime environment of the external tool configuration of the project to JDK7.
I assume you know how to add JDK7 to your installed jre in eclipse
Open External Tools Configurations... and then change the JRE to JDK 1.7
Then change the JRE
But this will create another problem, the compiled jar will be in JDK 7 and this will not work on production servers with JDK6.
To solve this, simply change the target attribute in the task to be 1.6
As per suggested from @dag and @Chris, Here is updated ant javac task.