I have installed two jdks - jdk 1.5 and jdk 1.8. I have following Ant build.xml config file :
I tried it with Eclise and got the same error Class not found: javac1.8
I verified the ANT version on my system
>ant -version
Apache Ant(TM) version 1.9.6 compiled on June 29 2015
When I tried to run the build.xml from the command prompt, it worked. Then I checked that in the Eclipse, it was referring to the older version of the ANT.
I simply edited the ANT HOME path in the Eclipse and it worked from here also. :)
Below is the image from where need to edit the ANT Path in the Eclipse.
Now change the ANT Home path from here.