On 09/20/2013 12:16 PM, Les Mikesell wrote:
On Fri, Sep 20, 2013 at 8:39 AM, Farrukh Najmi <farrukh.n...@gmail.com> wrote:
Hi Guys,

Initially all was well and my Jenkins config.xml was configured for just
JDK7.
I then added a JDK6 installation to Jenkins config and did a new build
manually.
The build failed and on examination I realized my project requires JDK7 to
build.
So I edited my Jenkins config to delete the JDK6 installation I had added
prior to previous build that had failed.
Now only the JDK7 installation was left in Jenkins config.

I did another build but now I see that it is still trying to build with JDK6
only instead of the JDK6 installation I had added from Oracle it is now
using the JDK 6 that is part of my Ubuntu setup.

What am I doing wrong and how can I make Jenkins only use the JDK7 that I
have configured?
You should be able to use multiple JDK versions and select them by
job.   In the global jenkins configuration under JDK installations,
give each JDK a name, then in the node configurations under tool
locations, add the appropriate path to each named JDK installation.
And in the job, pick the JDK version by name.


The fix was to make sure I had multiple JDKs configured in global config. This enabled the JDK selection pulldown to be visible above "Advanced Project Options" section. There I select a specific JDK (JDK 7 in my case) and all is well.

Note that I do not recall ever setting a JDK for my job explicitly.

It seems that Jenkins had originally correctly chosen on its own my only configured JDK (instead of Default JDK). When I added and deleted a second JDK then Jenkins on its own switched to Default JDK (instead of the only configured JDK).

This seems to be unexpected behavior.

--
Regards,
Farrukh Najmi

Web: http://www.wellfleetsoftware.com

--
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 jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to