'file.separator' in Windows platform is backslash('\'), but the 'javadoc' task doesn't seem to encode single backslash to doubled one ('\\'), so it outputs the error messages such as: [javadoc] javadoc: File not found: "C:Documents and SettingsTrustin LeeMy Documentsworkspacericasrcjava [javadoc] etgleamynodecollectionIntList.java" The actual file path had to be: "C:\Document and Settings\Trustin Lee\My Documents\workspace\arica\src\java\net\gleamynode\net\collection\IntList.java" The worksaround for this problem is to specify '-Dfile.separator=/' in command line. It is quite weird this bug still exists, no windows ant users anywhere? :)
This is interesting; nobody else has picked up on it. And if you look at the javadoc manual, you can see that Sun explicitly show non-escaped backslashes in the external file. http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#argumentfiles What version of java/javadoc are involved here?
I am using Sun JDK 1.4.2. I ran Ant in Cygwin commandline. I used Ant 1.6.1 via Maven; I modified startup script files for Maven to use Ant 1.6.1, because Ant 1.5.1 which is bundled with Maven has the bug that it cannot process the path which contains spaces. Is Cygwin or Maven the cause of this problem?
I'm having the same problem in Ant 1.6.2 with Sun's JDK 1.4.2_02 under Windows XP.
Sorry, it's actually 1.4.2_01 (not 1.4.2_02) for me.
Here's the diff for this against version 1.130 1887,1888d1886 < sourceFileName = sourceFileName.replaceAll("\\\\", < "\\\\\\\\"); Haven't tested on unix though.
I found this issue while fixing NetBeans issue <http://www.netbeans.org/issues/show_bug.cgi?id=51372>. I can reproduce the problem on WinXP too and playing directly with the javadoc.exe from JDK 1.4.2 or from 1.5 I believe that it is JDK bug. I filed it as <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6202474>
For forked javac we already replace \ with / which should work on Windows as well, if I read the original comment correctly. Just done so in Javadoc now. Maybe this only happens if the file name is quoted? Ant only quotes the names if they contain a space, so maybe it just didn't happen for most users because they don't run Ant in directories with spaces in their names. I've just assumed this is the case (since we only map \ to / in javac if we quote the file names as well). Should work in CVS HEAD. If anybody could run some tests on Windows, that would be fine, since I won't merge it into Ant 1.6.3 myself (can't test it since I don't run Windows) otherwise.
just assigning it to myself so that I remember merging it or moving the target milestone to 1.7.
Stefan do you still plan to fix this for 1.6.3? Let me know if you want help.
I don't run Windows, so I can't really test it. All I need is a confirmation that the problem is fixed and I haven't created new ones.
It does appear to be fixed in the trunk. Methodology: XP, JDK 1.5.0. I created a dir e:\test27814\nasty dir with spaces\ and put in it a build.xml: <project default="x"> <target name="x"> <javadoc destdir="jd" useexternalfile="true"> <fileset dir="src"/> </javadoc> </target> </project> where src\pkg\Cnnn.java contain each "public class Cnnn {}", for nnn in 000..999. If I cd into this directory from the command shell (making sure that the cwd is reported as the full path name, not e.g. E:\test27~1\NASTYD~1\ or whatever it is), and run e:\ant162\bin\ant -v it fails with the usual messages like Could not find file e: test27814 astydirwithspaces indicating \t, \n, etc. are being treated as escape characters. If I run e:\antdev\bin\ant -v it succeeds; output mentions e.g. [javadoc] Loading source file E:/test27814/nasty dir with spaces/src/pkg/C042.java... which looks OK. So I believe this is FIXED for 1.7 but still broken in 1.6.3. I would recommend merging the fix, though it would be nice if someone who actually runs Windows on a daily basis could confirm that nothing obvious was broken by it.
For reference, the patch in question seems to have been RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v revision 1.138 date: 2005/03/21 15:26:49; author: bodewig; state: Exp; lines: +3 -1 replace '\' if quoting file names, PR 27814
I use ant in a windows environment, and I've ran into this bug several times now. I can confirm that the version "ant_20050525041200" (cvs snapshot) fixes the bug, while release 1.6.4 does not. I've tested this by running the "dist-all" target on the project I'm currently working on (generate all distributions for the project, including sources and javadocs. The target also uses some external tasks such as xdoclet). I would very much like the bugfix to be included in the next release, so if there's anything I can do to help/assert in this process, please let me know.