echo ERROR: Environment variable JAVA_HOME has not been set.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo location of your Java installation.
echo.
echo.
gotoend
gotoend
:have_JAVA_HOME
@rem Validate JAVA_HOME
%COMMAND_COM% /C DIR "%JAVA_HOME%"2>&1|%FIND_EXE% /I /C "%JAVA_HOME%">nul
ifnoterrorlevel1gotoinit
echo.
echo ERROR: JAVA_HOME might be 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 if there are problems.
echo.
:init
:init
@rem get name of script to launch with full path
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windowz variants
SET_marker=%JAVA_HOME: =%
@rem IF NOT "%_marker%" == "%JAVA_HOME%" ECHO JAVA_HOME "%JAVA_HOME%" contains spaces. Please change to a location without spaces if this causes problems.