I'm confused. This line
if not "%JAVA_HOME%" == "C:\Program Files\Java\jdk1.6.0_05" goto gotJdkHome
checks that JAVA_HOME is "C:\Program Files\Java\jdk1.6.0_05" and if it is returns false. Why is that? The original file (the unchanged one) looks like this
rem Make sure prerequisite environment variables are set
if not "%JAVA_HOME%" == "" goto gotJdkHome
if not "%JRE_HOME%" == "" goto gotJreHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
goto exit
and it works fine on my computer... Just tested.