The reason is long and boring, but I need to run an Ant script to compile Java 1.5 code from a Java 1.4 app. I keep getting this error, though:
BUILD FAILED
Another way to make this work is to add 'tools.jar' to your classpath. The javac compiler is contained within this jar.
java -cp $JAVA_HOME/lib/tools.jar ...