Opening the details of the error shows that the ant build failed due to a coonflicted version of the jre.
In order to remove this error, you need to right click on the ant file. In the Run As you need to click on Open External Tools Dialog as shown in figure.
In the dialog box, under the Ant Build, select the ant build file you need to set the JRE for. Open the tab named JRE, probably at the extreme right of the dialog box. And select the JRE which you are using for development.