So for reason of running many projects, I don't want to change JAVA_HOME variable (1.6) but I would like ant to run and use 1.5 JDK.
I have manage to do this from Eclipse IDE (so it can be done), so when running from Eclipse IDE it will use 1.5 since I specified JDK 1.5 as project's JDK.
To make long story short I want Ant when run from cmd prompt to use JDK 1.5.
Seems pretty easy but I am having trouble finding out the way to do it.
P.S.
Reason I need this to work from command prompt is because ant build is quite long 3-4 mins and my Eclipse IDE gets frozen while it's running. Three minutes waits are simply not acceptable :)
Thanks all.
解决方案
You can write your own script, called ant2 or similar, to execute ant from the JDK that you want and add it into the PATH.