Its been a while since I did a maven build under Jenkins or Hudson, but somewhere it notes that the system jdk is used to fire up Java-based build steps. There should be a checkbox somewhere in the config to start a separate Java instance and NOT use the default system jdk. Of course, that will require forking and starting up the different jdk, so it will slow your build down slightly...
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Les Mikesell Sent: January-27-15 16:12 To: jenkinsci-users Subject: Re: Alternate JDK on slave box On Tue, Jan 27, 2015 at 2:57 PM, Gilles Devaux <[email protected]> wrote: > Hi, > > I have installed two JDKs on a slave box, JDK7 (default) and JDK8 > (without update-alternatives). I'm trying to build something with the > JDK8 but no luck. > > I'm setting "JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-x64/" in several > places, String build parameter, inject environment, something like this in > the DSL: > > ``` > wrappers { > environmentVariables { > env('JAVA_HOME', '/usr/lib/jvm/jdk-8-oracle-x64/') > } > } > parameters { > stringParam('JAVA_HOME','/usr/lib/jvm/jdk-8-oracle-x64/') > } > environmentVariables( > JAVA_HOME: '/usr/lib/jvm/jdk-8-oracle-x64/' > ) > ``` I'm not using maven, but doesn't this work like the other JVM settings? That is, give the JVMs names in the global configuration, then set/override the location in the node config tools section, and then pick the JDK name in the job config. The location should get exported as JAVA_HOME. -- Les Mikesell [email protected] -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAOAgVpzZup6cZ_ECmWV9hsORWx916Obp%3DJVbw-a%2BKmFjoAjoGA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a91106ce9cec42c4a0f89949b5553e5a%40mbx01colo01p.esentire.local. For more options, visit https://groups.google.com/d/optout.
