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
Does the javac task in your buildfile have fork="yes"
? If not, then it doesn't matter what the java.home
property is set to; ant will attempt to call the javac Main
method in the same java process, which from your error is a JRE, not a JDK.
EDIT Try setting the executable
property of your javac task to the full path to the javac
binary and add compiler="extJavac"
to the task.