It is annoying I am trying to find a global solution for more than a year! I work on projects that somehow manage to be JDK 1.5 dependent - libs some other Ant libs whatever. At the same time I want to boot my favorite IDE using the latest JavaVM so that I can get better performance!
So now I have Java 1.6 on the system and a project that needs to be compiled on 1.5
The thing is that when i try to build or invoke Ant from the IDE, it is lunched with Java 1.6 - it inherits the default JVM (as altered) from /etc/conf file. Setting a different platfrom etc does not work - when Ant is invoked it reports using Java 1.6 .
According to this and this - i still believe that there is no workaround!