You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Scott Matthews <sc...@rocsoftware.com> on 2001/08/20 16:20:28 UTC

Ant.bat on Windows98

I am new to the ANT utility.  I am using Windows 98.

Initially I had trouble getting the ANT utility to work correctly.  After 
installation, the first thing I tried was:
"ant -version" and got the following error message:
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/tools/ant/Main

It turns out that in the "ant.bat" file, there is a batch command:
for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" "%%i"
    that did not work correctly.
I had to REM out this line and add the following 3 lines below the REM 
statement to make it work:
if exist "%ANT_HOME%\lib\ant.jar" call "%ANT_HOME%\bin\lcp.bat" 
"%ANT_HOME%\lib\ant.jar"
if exist "%ANT_HOME%\lib\jaxp.jar" call "%ANT_HOME%\bin\lcp.bat" 
"%ANT_HOME%\lib\jaxp.jar"
if exist "%ANT_HOME%\lib\parser.jar" call "%ANT_HOME%\bin\lcp.bat" 
"%ANT_HOME%\lib\parser.jar"

Question:
Did I set something up incorrectly or does Windows98 have a problem with 
the "for" batch command?

Thanks.


Re: Ant.bat on Windows98

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Scott,

----- Original Message -----
From: "Scott Matthews" <sc...@rocsoftware.com>
> Question:
> Did I set something up incorrectly or does Windows98 have a problem with
> the "for" batch command?

Windows98 cannot properly handle for commands on long filenames.

Move your ant install to a short filename such as
C:\ant

Conor