I have a number of projects running on a Hudson slave. I\'d like one of them to run Ant under Java6, rather than the default (which is Java5 in my environment).
In t
It turns out that if you make the build parametrised, any string parameters you add become environment variables. With this approach, it is possible to set any environment variable for the build, including JAVA_HOME, which is picked up by Ant.
So the best solution for me was:
It's not obvious that build string parameters become environment variables, but once you know that they do, it's easy to set the JDK this way.
The developers on the Hudson mailing list recommended another approach using the master JDK configurations and overrides in the node configurations... but just setting the JAVA_HOME env var seems way easier to me.