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\..
  +if not "%JAVA_HOME%" == "" goto valid_JAVA_HOME
  +java -version 2>NUL
  +if not ERRORLEVEL 1 goto default_JAVA_EXE
   
   echo.
   echo ERROR: Environment variable JAVA_HOME has not been set.
  -echo.
  -echo Please set the JAVA_HOME variable in your environment to match the
  -echo location of your Java installation.
  -echo.
  -goto end
  +echo Attempting to find JAVA_HOME from PATH also failed.
  +goto common_error
   
   :have_JAVA_HOME
   @rem Remove trailing slash from JAVA_HOME if found
  
positive.code: 
  @rem Validate JAVA_HOME
  %COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
  if not errorlevel 1 goto check_GROOVY_HOME
  
  echo.
  echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
  echo.
  echo Please set the JAVA_HOME variable in your environment to match the
  echo location of your Java installation.
  echo.
  goto end
  
  :check_GROOVY_HOME
  @rem Define GROOVY_HOME if not set
  
negative.code: set STARTER_MAIN_CLASS=org.codehaus.groovy.tools.GroovyStarter
  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%"
  
  