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.
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
@rem get name of script to launch with full path
@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.
ifnot"%OS%"=="Windows_NT"gotowin9xME_args
if"%eval[2+2]"=="4"goto4NT_args
IF"%_marker%"=="%JAVA_HOME%"goto:win9xME_args
set_FIXPATH=
call:fixpath"%JAVA_HOME%"
setJAVA_HOME=%_FIXPATH:~1%
gotowin9xME_args
:fixpath
ifnot%1.==. (
for/f"tokens=1* delims=;"%%a in(%1)do(
call:shortfilename"%%a"&call:fixpath"%%b"
)
)
goto:EOF
:shortfilename
for%%i in(%1)doset_FIXPATH=%_FIXPATH%;%%~fsi
goto:EOF
:win9xME_args
@rem Slurp the command line arguments.
setCMD_LINE_ARGS=
set_SKIP=2
:win9xME_args_slurp
if"x%~1"=="x"gotoexecute
setCMD_LINE_ARGS=%*
gotoexecute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software