You can apparently specify an environmental variable to tell it which JVM to use: JAVACMD - full path of the Java executable. Use this to invoke a different JVM than JAVA_HOME/bin/java(.exe). But as for on the fly, that I can't find information on...
Theodore Jonathan Casser
SCJP/SCSNI/SCBCD/SCWCD/SCDJWS/SCMAD/SCEA/MCTS/MCPD... and so many more letters than you can shake a stick at!
There are two targets involved with the javac tag that you may use to change this. You need to set the fork tag to yes and the executable tag needs to to be set to the path of the javac executable that you with to use.