I would like to use JDK 1.6 for the project branch, while others continue to use JDK 1.5. Developers sometimes want to switch between them.
So what is the best way to tell Ant javac which JDK to use? At best, I mean solid, transparent, low maintenance, with the version along with the source (Ant and JDK, of course not, but they live in standard places).
The obvious is better than I expect it to be outside Ant: keep modifying the env JAVA_HOME variable. However, this requires that the developers manually switch (one more thing to remember: the error is affected), changing all -many-build servers (now works more for me).
Looking for some simple javac attribute like jdk-path , I noticed a few instead (thanks for reading on the net and in SO):
compiler is fair enough, but docs says "modern: .. javac1.5 and javac1.6 .. as aliases." For me, this suggests that it will not make any difference - right?source - seems to apply only to the JLS version (although not 100% of the document linked above)target - bytecode versionbootclasspath - some SO answers mention this, but are rather obscure and seem hacky.executable - the path to javac, but not to libs .. - seems to be the closest match, implicit JDK path specification? UPDATE: verified by JB Nizetfork - it seems I need true here (otherwise it will simply ignore the above without errors?). UPDATE: any performance implications or default? (I think JVM startup time is better, but still)
So, it seems that none of them helps on its own .. is there any combination of these equivalents to set JAVA_HOME before running Ant?
I have some hacks in my head (for example, the ant wrapper executable on each platform just to make sure that env var is pretty sad), but I really hope that I missed something :)
inger
source share