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
javac option is available in tools.jar. In eclipse, even if your JRE HOME points to a jdk, all the system libraries point to JDK_HOME\jre\lib. There is no tools.jar. You can add tools.jar as an external Jar file. This should solve your issue