Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21653

Gradle build command not working as Gradle version is unavailable for selection in Configure

XMLWordPrintable

      My gradle build works fine when I do it via the command prompt. While doing it via Jenkins, I get the following error:
      Started by user anonymous
      Building in workspace /var/lib/jenkins/jobs/unite/workspace
      [Gradle] - Launching build.
      [workspace] $ gradle build -b /run/media/navin/Data/GitRepositories/unite/build.gradle
      FATAL: command execution failed
      java.io.IOException: Cannot run program "gradle" (in directory "/var/lib/jenkins/jobs/unite/workspace"): error=2, No such file or directory
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
      at hudson.Proc$LocalProc.<init>(Proc.java:244)
      at hudson.Proc$LocalProc.<init>(Proc.java:216)
      at hudson.Launcher$LocalLauncher.launch(Launcher.java:773)
      at hudson.Launcher$ProcStarter.start(Launcher.java:353)
      at hudson.Launcher$ProcStarter.join(Launcher.java:360)
      at hudson.plugins.gradle.Gradle.performTask(Gradle.java:236)
      at hudson.plugins.gradle.Gradle.perform(Gradle.java:118)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:784)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:565)
      at hudson.model.Run.execute(Run.java:1670)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:231)
      Caused by: java.io.IOException: error=2, No such file or directory
      at java.lang.UNIXProcess.forkAndExec(Native Method)
      at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
      at java.lang.ProcessImpl.start(ProcessImpl.java:130)
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
      ... 16 more
      Build step 'Invoke Gradle script' changed build result to FAILURE
      Build step 'Invoke Gradle script' marked build as failure
      Collecting metadata...
      Metadata collection done.
      Finished: FAILURE

      Google searching showed the error could be because of not selecting the Gradle version http://stackoverflow.com/questions/8646762/cannot-run-program-gradle-in-jenkins

      But when I click the dropdown menu to select the Gradle version, there is no version number shown at all. There's just "Default".
      I'm using version 1.23 of the Gradle plugin, Firefox version 25, using Jenkins.war and starting it as sudo service jenkins start on localhost:8080. Using jdk1.7.0_45. This is my first install of Jenkins.

            gbois Gregory Boissinot
            nav Navin I
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: