While running ant build, I received this warning.
warning: [options] bootstrap class path not set in conjunction with -source 1.7Eclipse Error
Now in my first opinion, I find that maybe Ant was the issue as I do try running a standard main program and it was working. Finally the issue was found in the next statement.
When having installed multiple JDKs on my system, I realized that was the major cause of issue. I am compiling in Java 7 while JAVA_HOME is 8.
Java Ant Solution
Just change the JAVA_HOME via “System environment” or use cmd line in Command Prompt (with Administrator Privilege) and set JAVA_HOME = <jdk path>