anchor.diff:  :check_JAVA_HOME
   @rem Make sure we have a valid JAVA_HOME
   if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
  -for %%P in (%PATH%) do if exist %%P\..\bin\java.exe set JAVA_HOME=%%P\..
  +set PATHTMP=%PATH%
  +:loop
  +for /f "delims=; tokens=1*" %%i in ("!PATHTMP!") do (
  +    if exist "%%i\..\bin\java.exe" (
  +        set "JAVA_HOME=%%i\.."
  +        goto found_JAVA_HOME
  +    )
  +    set PATHTMP=%%j
  +    goto loop
  +)
  +goto check_default_JAVA_EXE
  +
  +:found_JAVA_HOME
  +@rem Remove trailing \bin\.. from JAVA_HOME
  +if "%JAVA_HOME:~-7%"=="\bin\.." SET "JAVA_HOME=%JAVA_HOME:~0,-7%"
  +set JAVA_EXE=%JAVA_HOME%\bin\java.exe
  +
  +:check_default_JAVA_EXE
   if not "%JAVA_HOME%" == "" goto valid_JAVA_HOME
   java -version 2>NUL
   if not ERRORLEVEL 1 goto default_JAVA_EXE
  
positive.code: set STARTER_MAIN_CLASS=org.codehaus.groovy.tools.GroovyStarter
  if "%STARTER_CONF%" == "" set STARTER_CONF=%GROOVY_HOME%\conf\groovy-starter.conf
  
  if "%JAVA_OPTS%" == "" set JAVA_OPTS="-Xmx128m"
  set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name="%PROGNAME%"
  set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.home="%GROOVY_HOME%"
  if not "%TOOLS_JAR%" == "" set JAVA_OPTS=%JAVA_OPTS% -Dtools.jar="%TOOLS_JAR%"
  set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%"
  set JAVA_OPTS=%JAVA_OPTS% -Dscript.name="%GROOVY_SCRIPT_NAME%"
  
  if exist "%USERPROFILE%/.groovy/postinit.bat" call "%USERPROFILE%/.groovy/postinit.bat"
  
  @rem Execute Groovy
  "%JAVA_EXE%" %JAVA_OPTS% -classpath "%STARTER_CLASSPATH%" %STARTER_MAIN_CLASS% --main %CLASS% --conf "%STARTER_CONF%" --classpath "%CP%" %CMD_LINE_ARGS%
  
  :end
  @rem End local scope for the variables with windows NT shell
  
negative.code: @rem
  
  @rem Set local scope for the variables with windows NT shell
  if "%OS%"=="Windows_NT" setlocal enabledelayedexpansion
  
  set DIRNAME=%~1
  shift
  