I've just spent the last several hours debugging why ant would not launch. Granted a dum-dum on my part but to save future users the grief I would add a statement to the installation instructions that specify to leave off the trailing \ in the ANT_HOME env variable on Windows as this will cause the ant.bat script to FAIL. Thanks.
Hi, First of all *thanks* for submitting the first ant 1.6.1 bug report, this is worth drinking a glass of wine. Second, you have been caught by an annoyance which has hit other people in the past. I suggest to do the following in ant.bat (will work only under NTish operating systems, but this is the tendency of the batch anyway) : for %a in (%ANT_HOME%) do set ANT_PARENT_DIR=%~dpa if "%ANT_PARENT_DIR%"=="%ANT_HOME%" goto error goto next :error echo ANT_HOME *must not* end with a backslash echo you have set ANT_HOME to %ANT_HOME% pause exit 1 :next
Well, as you write Antoine, %~dpa is not portable to Win9x... I used to do the following HACK to get rid of trailing slashes: :: Remove back-slash or forward-slash at end of path, if any set JAVA_HOME=%JAVA_HOME%# set JAVA_HOME=%JAVA_HOME:\#=% set JAVA_HOME=%JAVA_HOME:/#=% set JAVA_HOME=%JAVA_HOME:#=% Used to work, but was not tested on all platforms. Should work on WinNT, Win2K, WinXP. --DD
If we strip win9x support out of ant1.7 this fix can be applied.
*** Bug 40872 has been marked as a duplicate of this bug. ***
The manual now states that ANT_HOME shouldn't end in a backslash. Renaming the report and marking it as enhancement request - once we are ready to drop win95 support (or have we already?).
I thought we voted to drop support of Win95 & Win98 a couple of years back... IIRC Steve or I might have spearheaded that one.