I am coming to the conclusion that something is not working misunderstood 
by me (or not working correctly) as to how Jenkins sets up its environment 
variables and specially the PATH and JAVA_HOME env vars.

I tried setting key env vars in global config. 

Here is what it looks like in ~jenkins/config.xml:

  <globalNodeProperties>
    <hudson.slaves.EnvironmentVariablesNodeProperty>
      <envVars serialization="custom">
        <unserializable-parents/>
        <tree-map>
          <default>
            <comparator class="hudson.util.CaseInsensitiveComparator"/>
          </default>
          <int>3</int>
          <string>JAVA_HOME</string>
          <string>/var/lib/jenkins/tools/hudson.model.JDK/JDK_7</string>
          <string>MAVEN_HOME</string>
          
<string>/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven</string>
          <string>PATH</string>
          <string>$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH</string>
        </tree-map>
      </envVars>
    </hudson.slaves.EnvironmentVariablesNodeProperty>
  </globalNodeProperties>

Still, Jenkins insists on running the unqualified java command which seems 
to be stuck on. All I did was add and remove a JDK 6 installation and I 
cannot seem to figure out a way out of this issue :-(

On Friday, September 20, 2013 10:32:38 AM UTC-4, Farrukh Najmi wrote:
>
>  I am using job type of a maven multi-module project. There is no such 
> JDK List Box that I see. Here is a screenshot of my project config:
>
> http://wellfleetsoftware.com/files/tmp/screenshot.png
>
> BTW, what determines whether the java command during build uses fully 
> qualified path or not?
>
> Thanks very much for your help Ulli!
>
> On 09/20/2013 10:22 AM, Ulli Hafner wrote:
>  
> What job type are you using? I have a JDK Listbox right above the advanced 
> project options section� 
>
>  Am 20.09.2013 um 16:01 schrieb Farrukh Najmi <farrukh.n...@gmail.com>:
>
>  I do not see a Java Version list box in my job config page in UI. I have 
> expanded varios Advanced section in the page but still do not see Java 
> Version list. I am using Jenkins version 1.531.
>
> The only Java Version available in Jenkins global config is JDK 7.
>
> One odd difference I notice in the logs for a successful build vs. failed 
> build is that the failed build uses java command without fully qualified 
> path while successful build uses fully qualified path to corect jdk.
>
> #From bad build piucking up JDK 6
>
> java -Djava.io.tmpdir=/var/lib/jenkins/tmp -cp 
> /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.4.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/boot/plexus-classworlds-2.4.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/conf/logging
>  jenkins.maven3.agent.Maven31Main 
> /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven 
> /var/cache/jenkins/war/WEB-INF/lib/remoting-2.32.jar 
> /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.4.jar 
> /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.4.jar
>  46644
>
>
> #From good build using JDK7
>
> /var/lib/jenkins/tools/hudson.model.JDK/JDK_7/bin/java 
> -Djava.io.tmpdir=/var/lib/jenkins/tmp -cp 
> /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.4.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/boot/plexus-classworlds-2.4.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/conf/logging
>  jenkins.maven3.agent.Maven31Main 
> /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven 
> /var/cache/jenkins/war/WEB-INF/lib/remoting-2.32.jar 
> /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.4.jar 
> /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.4.jar
>  52130
>
>
> This seems significant.
>
> Many thanks for your help Ullrich!
>
>
> On Friday, September 20, 2013 9:43:52 AM UTC-4, Ullrich Hafner wrote: 
>>
>> What values are in your Java Version list box in you job configuration? 
>> Which Java Versions are visible in Jenkins global configuration? Please use 
>> the UI only... 
>>
>>  Am 20.09.2013 um 15:39 schrieb Farrukh Najmi <farruk...@gmail.com>:
>>
>>  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?
>>  
>>      
>
> -- 
> 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