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

JAVA_HOME is set to an invalid directory when using Groovy in Docker on Windows

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Component/s: groovy-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.144
      Groovy plugin 2.0
      Docker plugin 1.1.5
      Windows 2016 with Docker 17.06.2-ee-16
    • Similar Issues:

      Description

      [fbce260c] $ c:\jenkinswork\tools\hudson.plugins.groovy.GroovyInstallation\Groovy_2.4.3\groovy-2.4.3\bin\groovy.bat c:\jenkinswork\workspace\infra\test-jdk-installs-docker\fbce260c\hudson6050613090235584392.groovy
      find: '/I': No such file or directory
      find: '/C': No such file or directory
      
      ERROR: JAVA_HOME is set to an invalid directory: c:\jenkins\jdk\JDK_1.6
      Please set the JAVA_HOME variable in your environment
      to match the location of your Java installation.
      

      In fact, JAVA_HOME is set correctly (in my case), and other steps (eg maven) work fine.

      The problem is that the batch script that invokes groovy uses "c:\windows\system32\find.exe", which is not part of the microsoft/nanoserver docker image that is fairly standard.

      Once I manually added the host's copy of find.exe, groovy step worked. Also, my custom docker image has cygwin, which means that due to the absence of the microsoft find.exe, it's invoking cygwin's.

        Attachments

          Activity

          Hide
          akom Alexander Komarov added a comment - - edited

          Sorry, I just realized that the bat file is part of groovy, not groovy-plugin (thought it was a temporary file). I'll bug them next

          Show
          akom Alexander Komarov added a comment - - edited Sorry, I just realized that the bat file is part of groovy, not groovy-plugin (thought it was a temporary file). I'll bug them next

            People

            • Assignee:
              vjuranek vjuranek
              Reporter:
              akom Alexander Komarov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: