I\'m using Ant 1.7.0 and installed java 1.6 which is in JAVA_HOME.
I want to build a project using java 1.5, so I\'ve exported JAVA_HOME to be my java 1.5 directory.
According to the ant manual, setting JAVA_HOME should work - are you sure the changed setting is visible to ant?
Alternatively, you could use the JAVACMD variable.