How can I configure a Hudson job to use a specific JDK?

Posted by rewbs on Stack Overflow See other posts from Stack Overflow or by rewbs
Published on 2009-04-14T14:31:59Z Indexed on 2010/05/27 11:31 UTC
Read the original article Hit count: 179

Filed under:
|
|

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 the project configuration view, I was hoping to find either:

  • An explicit option allowing me to set a custom JDK location to use for this project.
  • A way to set custom environment variables for this project, which would allow me to set JAVA_HOME to the JDK6 location. The would make Ant pick up and run on Java6 as desired.

Is there a way to do either of the above? If one of those facilities is available, I can't see how to access it. I'm running on Hudson 1.285.

I would rather avoid using an "execute shell" operation instead of the "invoke Ant" operation if possible: my slave is on z/OS and Hudson doesn't seem to create the temporary shell scripts properly on this platform (probably an encoding issue).

© Stack Overflow or respective owner

Related posts about java

Related posts about hudson