Yes, this is an old one, but came across at work and could not find a solution documented anywhere yet...
Even though I too came across this using Ant, it in fact does not seem to have anything to do with Ant - there seem to have been some broken JDK builds out there:
C:\>set JAVA_HOME=C:\Progra~1\Java\jdk1.6.0_45
C:\>%JAVA_HOME%\bin\javac -version
javac 1.6.0_45
C:\>%JAVA_HOME%\bin\javac -target 1.6
javac: no source files
Usage: javac
use -help for a list of possible options