I wrote an ant build.xml script and it runs well. But it seems it is using the default JDK that I set in my JAVA_HOME for the local machine. How to I specify a specific JDK version in my build.xml so the ant picks that one ?
If you want to run the javac compiler of a different JDK, you should tell Ant, where to find the compiler and which version of JDK you will be using so it can choose the correct command line switches. The following example executes a JDK 1.1 javac in a new process and uses the correct command line switches even when Ant is running in a Java VM of a different version: