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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • groovy-plugin
    • None
    • Jenkins 2.144
      Groovy plugin 2.0
      Docker plugin 1.1.5
      Windows 2016 with Docker 17.06.2-ee-16

      [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.

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

              Created:
              Updated:
              Resolved: