Sometimes the issue while building the war through ANT is also related to java version miss match in build.properties files as build.XML tries to use the java version mentioned in build.compiler property
check whether build.compiler property is same as intended java version.