ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Price <>
Subject Re: ant 1.5.1 problem on ant.bat
Date Fri, 28 Feb 2003 19:42:22 GMT

This is interesting -- earlier today I posted a very similar problem, 
although I am using ant under Cygwin.  Instead of modifying ant.bat, I 
modified the sh script (simply named "ant").  It now works perfectly.

For anyone who would like to use the sh script under Cygwin (I prefer it 
to DOS/batch), to modify this script to work with pathnames that have 
spaces, follow these steps:

1. In your text editor, search for the first occurrence of the following 

   `dirname "$PRG"`

(those are backticks surrounding the string, and yes, they are part of 
the string to search for.)

2. Insert a new line above the occurrence of this string containing the 
following text:

   DIRNAMEPRG=`dirname "$PRG"`

3. Now replace every occurrence of the first string (`dirname "$PRG"`) 
in the entire script with the following string:


Don't forget the doublequotes on the outside.  There really should be 
only two occurrences of the (`dirname "$PRG"`) string if you are using 
Ant 1.5.1.

After making this change, my ant script works perfectly.


Leonardo Holanda wrote:
> I was using an 1.5 successfully. When I updated to ant 1.5.1 it was
> returning the error:
> Exception in thread "main" java.lang.NoClassDefFoundError: de
> This error is caused by the weird form that windows use to store long names
> and entries with blank spaces in its filesystem. So, if you have any
> reference to "Program Files" in your path enviroment variables, it will
> cause this error.
> This error can be fixed by two diferent solutions:
> Solution 1. Edit the file ant.bat (the best one in my opinion).
> locate the line which contains:
> if exist "%JAVA_HOME%\lib\tools.jar" call "%ANT_HOME%\bin\lcp.bat"
> "%JAVA_HOME%\lib\tools.jar"
> and remove the double quotes in the last parameter. The line shoud looklike
> this:
> if exist "%JAVA_HOME%\lib\tools.jar" call "%ANT_HOME%\bin\lcp.bat"
> %JAVA_HOME%\lib\tools.jar
> Solution 2. Check your path enviroment variable. It cannot contain any blank
> space (like "Programa Files"). Use the ugly windows abreviated form instead
> (e.g. "progra~1") inherited since the pure DOS old times. Check also for
> references in this environment variables.
> I'm posting this error because I did't find it in the ant FAQ, problems or
> in the mail archives.
> Best regards,
> Leonardo Holanda.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message