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

后端 未结 9 1875
情话喂你
情话喂你 2020-12-05 06:44

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

9条回答
  •  我在风中等你
    2020-12-05 07:22

    I had a problem where the installed JDK was JDK 8 whereas I wanted Jenkins to use JDK 7 . So , after installing JDK 7 on the Jenkins build box ,

    I added the JDK path to jenkins Configurations :

    Jenkins -> Manage Jenkins -> Configure system -> JDK -> Add JDK name and Path

    Also , Edit jenkins-runner.sh: Add the line:

    export JAVA_HOME=""

    Change the last two lines to read:

    echo "/bin/java" $javaArgs -jar "$war" $args

    exec "/bin/java" $javaArgs -jar "$war" $args

提交回复
热议问题