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

Cannot run program "/bin/java" on maven 3 projects

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: maven-plugin
    • Labels:
      None
    • Environment:
      1.580, Ubuntu 12.04 LTS 64
    • Similar Issues:

      Description

      We've had this issue for a while, mostly after a slave is started where the maven command insist on using /bin/java. We do not have a /bin/java since we want to control the version of Java on a per job basis, so adding it is not an option.

      00:00:06.627 Parsing POMs
      00:00:07.322 maven3-agent.jar already up to date
      00:00:07.331 maven3-interceptor.jar already up to date
      00:00:07.341 maven3-interceptor-commons.jar already up to date
      00:00:07.347 [build-shnproxy-trunk] $ /bin/java -Xmx6000m -XX:MaxPermSize=2000m -cp /shn/builder/maven3-agent.jar:/shn/builder/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.5/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /shn/builder/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.5 /shn/builder/slave.jar /shn/builder/maven3-interceptor.jar /shn/builder/maven3-interceptor-commons.jar 33037
      00:00:07.353 ERROR: Failed to parse POMs
      00:00:07.353 java.io.IOException: Cannot run program "/bin/java" (in directory "/shn/builder/workspace/build-shnproxy-trunk"): java.io.IOException: error=2, No such file or directory
      00:00:07.353 	at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
      00:00:07.353 	at hudson.Proc$LocalProc.<init>(Proc.java:244)
      00:00:07.353 	at hudson.Proc$LocalProc.<init>(Proc.java:216)
      00:00:07.353 	at hudson.Launcher$LocalLauncher.launch(Launcher.java:802)
      00:00:07.353 	at hudson.Launcher$ProcStarter.start(Launcher.java:380)
      00:00:07.353 	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1135)
      00:00:07.353 	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1100)
      00:00:07.353 	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      00:00:07.353 	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      00:00:07.353 	at hudson.remoting.Request$2.run(Request.java:328)
      00:00:07.353 	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      00:00:07.353 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      00:00:07.353 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      00:00:07.353 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      00:00:07.353 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      00:00:07.353 	at java.lang.Thread.run(Thread.java:662)
      00:00:07.353 Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
      00:00:07.353 	at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
      00:00:07.353 	at java.lang.ProcessImpl.start(ProcessImpl.java:65)
      00:00:07.353 	at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
      00:00:07.353 	... 15 more

      Usually after a few failed builds the slave gets the correct version of java and works:

      Parsing POMs
      maven3-agent.jar already up to date
      maven3-interceptor.jar already up to date
      maven3-interceptor-commons.jar already up to date
      [build-shnproxy-trunk] $ /shn/builder/tools/hudson.model.JDK/JDK7/jdk1.7.0_51/bin/java -Xmx6000m -XX:MaxPermSize=2000m -cp /shn/builder/maven3-agent.jar:/shn/builder/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.5/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /shn/builder/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.5 /shn/builder/slave.jar /shn/builder/maven3-interceptor.jar /shn/builder/maven3-interceptor-commons.jar 58912
      <===[JENKINS REMOTING CAPACITY]===>���channel started
      

      This time it has been stuck for 2 jobs for the past 2 days, with no end in sight. I can't figure out why it keeps on pointing to /bin/java

        Attachments

          Activity

          Hide
          jminne jminne added a comment -

          James is correct. This is a usability bug. Thank you James!

          Show
          jminne jminne added a comment - James is correct. This is a usability bug. Thank you James!
          Hide
          danielbeck Daniel Beck added a comment -

          JENKINS-26940 is a duplicate of this issue, and I suggested the following there:

          Started by user anonymous
          Building in workspace /Users/danielbeck/Projects/Jenkins/jenkins_daniel-beck/war/work/jobs/JENKINS-26940/workspace
          Tool installer "Install from http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.4-bin.tar.gz" cannot be run on the node "Jenkins"
          FATAL: Cannot find executable from the chosen Ant installation "foo"
          Build step 'Invoke Ant' marked build as failure
          Finished: FAILURE

          Would that work for you?

          Show
          danielbeck Daniel Beck added a comment - JENKINS-26940 is a duplicate of this issue, and I suggested the following there: Started by user anonymous Building in workspace /Users/danielbeck/Projects/Jenkins/jenkins_daniel-beck/war/work/jobs/JENKINS-26940/workspace Tool installer "Install from http: //archive.apache.org/dist/ant/binaries/apache-ant-1.9.4-bin.tar.gz" cannot be run on the node "Jenkins" FATAL: Cannot find executable from the chosen Ant installation "foo" Build step 'Invoke Ant' marked build as failure Finished: FAILURE Would that work for you?
          Hide
          sudo 杨 唐 added a comment -

          try : ln -s ${which java} /bin/java

          Show
          sudo 杨 唐 added a comment - try : ln -s ${which java} /bin/java
          Hide
          peter_rader Peter Rader added a comment -

          Thanks i had a simmilar message:

          Cannot run program "java"

          ln -s solved my problem too.

          Show
          peter_rader Peter Rader added a comment - Thanks i had a simmilar message: Cannot run program "java" ln -s solved my problem too.
          Hide
          igorganapolsky Igor Ganapolsky added a comment -

          Where exactly do you run `ln -s`? Same directory as the project, or where your java tools are being executed from?

          Show
          igorganapolsky Igor Ganapolsky added a comment - Where exactly do you run `ln -s`? Same directory as the project, or where your java tools are being executed from?

            People

            • Assignee:
              Unassigned
              Reporter:
              sodul Stephane Odul
            • Votes:
              2 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated: