title: jenkins - java.io.IOException: Cannot run program "groovy"
body: <p>I have the following groovy script in a jenkins build</p>
  
  <pre><code>def myFractureNO = ${FRACTURE_NO};
  def myBuildNumber = ${BUILD_NUMBER};
  def projectXml = new XmlSlurper().parseText("curl http://sparkbuilder.corp.adobe.com:8080/job/FractureAUT/api/xml".execute().text);
  projectXml.build.each {
    if(it.number &lt; myBuildNumber)
    {
        def jobXml = new XmlSlurper().parseText(("curl http://sparkbuilder.corp.adobe.com:8080/job/FractureAUT/" + it.number + "/api/xml").execute().text);
  
        if(1) {
          def myparams = jobXml.getAction(hudson.model.ParametersAction.class);
          for( p in myparams ) {
               if (p.name.toString == "FRACTURE_NO") {
                  if (p.value.toString() == "$myFractureNO") {
                      println p.value.toString();
                  }
              }
          }
        }
     }
  }
  </code></pre>
  
  <p>I get an error saying</p>
  
  <pre><code>java.io.IOException: Cannot run program "groovy"
  </code></pre>
  
  <p>when jenkins tries to run this script on a Jenkins slave. How do I fix this?</p>
  
  <p>Now I get the following error when trying to execute the script as a system script</p>
  
  <pre><code>groovy.lang.MissingMethodException: No signature of method: Script1.$() is applicable for argument types: (Script1$_run_closure1) values [Script1$_run_closure1@5e38bed4]
  Possible solutions: is(java.lang.Object), run(), run(), any(), any(groovy.lang.Closure), use([Ljava.lang.Object;)
  at Script1.run(Script1.groovy:1)
  </code></pre>