Update refine.bat to check the value of JAVA_HOME later
The "Read ini file" part should be above the "Check JAVA_HOME" part.
In the refine.ini file a custom JAVA_HOME can be defined and if JAVA_HOME is checked before reading the ini file, the custom JAVA_HOME setting is never used.
@@ -76,19 +76,6 @@ set OPTS=
:endConfigReading
-rem --- Check JAVA_HOME ---------------------------------------------
-
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo You must set JAVA_HOME to point at your Java Development Kit installation
-echo.
-echo If you don't know how to do this, follow the instructions at
-echo.
-echo http://bit.ly/1c2gkR
-echo.
-
-goto fail
-:gotJavaHome
-
rem --- Argument parsing --------------------------------------------
:loop
@@ -159,6 +146,19 @@ for /f "tokens=1,* delims==" %%a in (%REFINE_INI_PATH%) do (
:endArgumentParsing
+rem --- Check JAVA_HOME ---------------------------------------------
+
+if not "%JAVA_HOME%" == "" goto gotJavaHome
+echo You must set JAVA_HOME to point at your Java Development Kit installation
+echo.
+echo If you don't know how to do this, follow the instructions at
+echo.
+echo http://bit.ly/1c2gkR
+echo.
+
+goto fail
+:gotJavaHome
+
rem --- Fold in Environment Vars --------------------------------------------
if not "%JAVA_OPTIONS%" == "" goto gotJavaOptions
