Alternatively, if you are on Windows, you can create 2 batch files: one that sets JAVA_HOME to 1.3, and then your ant call, the second that sets JAVA_HOME to 1.4, and then your ant call. eg:
startAnt1.3.bat:
SET JAVA_HOME=C:\Java1.3\etc. ant myTarget
startAnd1.4.bat:
SET JAVA_HOME=C:\Java1.4\etc. ant myTarget
source share