Bug 13582 - ant.bat broken on Windows 98
Summary: ant.bat broken on Windows 98
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Wrapper scripts (show other bugs)
Version: 1.5.1
Hardware: PC All
: P3 blocker (vote)
Target Milestone: 1.5.2
Assignee: Ant Notifications List
URL:
Keywords:
: 13369 14495 15996 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-10-13 19:15 UTC by Daniel Santos
Modified: 2008-02-22 12:18 UTC (History)
4 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Santos 2002-10-13 19:15:12 UTC
Line 32 reads:

if exist "%ANT_HOME%" goto checkJava

However, win98 sucks and doesn't think that any directory exists -- only files. 
So I modified it to work around the problem as such:

if exist "%ANT_HOME%\README" goto checkJava

pretty ugly huh?
Comment 1 Stephane Bailliez 2002-10-17 17:11:02 UTC
Can you tell me if it works if you use "%ANT_HOME%\nul" ?
(yes this is 'nul' not 'null').
Comment 2 Stephane Bailliez 2002-10-17 18:00:40 UTC
*** Bug 13369 has been marked as a duplicate of this bug. ***
Comment 3 Daniel Santos 2002-10-17 18:15:08 UTC
Yes, "%ANT_HOME%\nul" does work. Had I read the rest of the file I might have 
tried that.
Comment 4 Stephane Bailliez 2002-10-17 18:35:35 UTC
I'm glad that it works for you under Win9x because it does not work at all 
under Winxp. 1) works ok but not 2) :-(

1)
if exist c:\directory\nul echo Booh

2)
set BLAH=c:\directory
if exist %BLAH%\nul echo Booh

I hate batch files
Comment 5 John O'Donahue 2002-12-05 17:53:48 UTC
ant.bat from 1.5 worked for me
Comment 6 Antoine Levy-Lambert 2003-01-27 21:09:13 UTC
This works under Win2000 too :
set BLAH=c:\directory
if exist %BLAH%\nul echo Booh
Could 
someone retry it under XP to make sure that it does not work there ?
Comment 7 Sean Reilly 2003-01-27 21:19:53 UTC
Case 2
(
set BLAH=c:\directory
if exist %BLAH%\nul echo Booh
)

works fine for me under win xp.

This may also be a possible solution:
set BLAH=c:\directory
if exist %BLAH%\. echo Booh

This works under xp.  I assume it will also work in 2k/9x as "." is a file 
that always exists in a directory.
Comment 8 Anders Cederlund 2003-01-28 09:14:24 UTC
if exist "%ANT_HOME%\." goto checkJava

... does not work in my win98.
The following works as long as you don't rename the script.

if exist "%ANT_HOME%\bin\ant.bat" goto checkJava

Comment 9 Conor MacNeill 2003-02-02 05:38:19 UTC
Fixed. I have changed the existence check to check for %ANT_HOME%\lib\ant.jar -
should always be there
Comment 10 Conor MacNeill 2003-02-02 05:39:48 UTC
*** Bug 15996 has been marked as a duplicate of this bug. ***
Comment 11 Conor MacNeill 2003-02-02 13:27:15 UTC
*** Bug 14495 has been marked as a duplicate of this bug. ***
Comment 12 Conor MacNeill 2003-02-07 05:19:44 UTC
*** Bug 16867 has been marked as a duplicate of this bug. ***