I downloaded and built the jboss 4.0.3SP1 first. It did go smoothly without any problems.
Then I set the JBOSS_HOME envvar like it documentation. I can see in my command promt that JBOSS_HOME is pointing correct folder.
C:\devel\jboss-portal-2.2.1RC2-src\build>set JBOSS_HOME JBOSS_HOME=C:\appservers\jboss C:\devel\jboss-portal-2.2.1RC2-src\build>
I downloaded 2.2.1rc2 sources and go to build folder and try to start build but it fails miserably.
C:\devel\jboss-portal-2.2.1RC2-src\build>build Executing C:\devel\jboss-portal-2.2.1RC2-src\build\..\tools\bin\ant.bat -logger org.apache.tools.ant.NoBannerLogger Exception in thread "main" java.lang.NoClassDefFoundError: Files\Java\jdk1/5/0_05\lib\tools/jar;C:\devel\jboss-portal-2/2/1RC2-src\build\//\tools\lib\ xml-apis/jar;C:\devel\jboss-portal-2/2/1RC2-src\build\//\tools\lib\xercesImpl/jar;C:\devel\jboss-portal-2/2/1RC2-src\build\//\tools\lib\xalan/jar;C:\d evel\jboss-portal-2/2/1RC2-src\build\//\tools\lib\saxon/jar;C:\devel\jboss-portal-2/2/1RC2-src\build\//\tools\lib\optional/jar;C:\devel\jboss-portal-2 /2/1RC2-src\build\//\tools\lib\junit/jar;C:\devel\jboss-portal-2/2/1RC2-src\build\//\tools\lib\explode/jar;C:\devel\jboss-portal-2/2/1RC2-src\build\// \tools\lib\crimson/jar;C:\devel\jboss-portal-2/2/1RC2-src\build\//\tools\lib\buildmagic-tasks/jar;C:\devel\jboss-portal-2/2/1RC2-src\build\//\tools\li b\bsf/jar;C:\devel\jboss-portal-2/2/1RC2-src\build\//\tools\lib\ant/jar;
Ok. There must be something wrong here because my JAVA_HOME is:
C:\devel\jboss-portal-2.2.1RC2-src\build>set JAVA_HOME JAVA_HOME=C:\Program Files\Java\jdk1.5.0_05 C:\devel\jboss-portal-2.2.1RC2-src\build>
and it tried to add "Files\Java\jdk1/5/0_05\lib\tools/jar" into classpath.
I moved JAVA_HOME into c:\jdk1.5.0_05 and build seems to work. Evidently build.bat can't handle spaces in JAVA_HOME environment variable very well.
Anyone else having this kind of problem. After all, that is default installation location for jdk and it should work fine with little tweak to build.bat.