title: Jenkins Windows slave: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK
body: <p>I just setup a new jenkins slave which is running Windows server 2012. I already installed jdk-8u221-windows-x64 and set Java_home, Path like below</p>
  
  <pre><code>C:\Users\Administrator&gt;echo %JAVA_HOME%
  C:\Program Files\Java\jdk1.8.0_221\
  
  C:\Users\Administrator&gt;echo %PATH%
  C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\
  Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\
  Program Files\Amazon\cfn-bootstrap\;C:\Program Files\Git\cmd;C:\Program Files\Ja
  va\jdk1.8.0_221\\bin;C:\maven\bin;C:\maven\bin
  </code></pre>
  
  <p>However,build job running in this slave always complain that:</p>
  
  <blockquote>
    <p>No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK</p>
  </blockquote>
  
  <p>Any idea of what might be causing this?</p>
  
  <p><em>Update Sep 11th, 2019</em></p>
  
  <p>I configure the slave node as method 2 of Technext's suggestion
  <a href="https://i.stack.imgur.com/ZwPJT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZwPJT.png" alt="enter image description here"></a></p>
  
  <p>In a Job build configuration, I selected (System) in JDK option. If I choose JDK 8 update 221, this build job run successfully, but I want to use a (System) JDK which will get from environment variable in this node, so I can switch to another slave node without changing the JDK option.
  <a href="https://i.stack.imgur.com/BobxH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BobxH.png" alt="enter image description here"></a></p>
  
  <p>However, when I remote to this server, and open command prompt, move on to workspace folder of this project, let say: C:\jenkins_slave\workspace\project01\, then type the command: mvn clean install, it run without complain about jdk or jre as run from Jenkins. </p>