title: Jenkins will not use Java 7 compiler
body: <p>I'm working with a team on a maven project, and I set up a build job for it in Jenkins.</p>
  
  <p>Recently, someone on the team added code that switches on a String.  This caused the build to fail in Jenkins with the following error:</p>
  
  <pre><code>error: strings in switch are not supported in -source 1.5
  </code></pre>
  
  <p>So of course I realized Jenkins needs to be using Java 7, not Java 5.</p>
  
  <p>First, I remoted into the server, opened a cmd, and did <code>where java</code> and <code>java -version</code>.  I checked my environment variables and my path.  Everything is pointing to the same Java 7 jdk directory: <code>C:\Java\jdk1.7.0_21</code>.</p>
  
  <p>Then I checked Jenkins to see if it was configured to use the correct JDK.  It is:
   <img src="https://i.stack.imgur.com/6yeIm.png" alt="Jenkins JDK"></p>
  
  <p>In fact, that's the only Java that the Jenkins server is set up to use, and it's the only Java installed in the Server.</p>
  
  <p>As a last resort, I installed the JDK parameter plugin into Jenkins.  I then set the project to use the Java 7 parameter:</p>
  
  <p><img src="https://i.stack.imgur.com/tbowb.png" alt="Parameter JDK"></p>
  
  <p>But still, I get the same error.</p>
  
  <p>Am I missing something?  What could be causing this?  Most importantly, how can I solve it and get Jenkins to use <code>-source 1.7</code> instead of <code>-source 1.5</code>?</p>