Build.bat could not find the %JAVA_HOME% if tjhe java directory contains spaces, like <program files\java\...>
the solution is to replace %JAVA_HOME% with "%JAVA_HOME%" so that line 9 in build.bat becomes:
set CP="%JAVA_HOME%"\lib\tools.jar;%DIRLIBS%
the build was ok, i have not tested it yet though