Bug 52834 - javadoc-build target breaks when javac.classpath contains spaces
javadoc-build target breaks when javac.classpath contains spaces
Status: RESOLVED FIXED
Product: javaee
Classification: Unclassified
Component: Web Project
4.x
All All
: P3 (vote)
: 4.x
Assigned To: Radko Najman
issues@javaee
: SPACE_IN_PATH
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-31 20:22 UTC by ajenkins
Modified: 2005-02-23 13:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ajenkins 2004-12-31 20:22:50 UTC
This problem occurs with a Web Application project
created under Netbeans 4.0, when I run the
Generate Javadoc command for the project.  

If the compilation classpath for the project
contains any paths which contain spaces, then
error messages will be generated, like this:

javadoc-build:
javadoc: Illegal package name:
"Files\netbeans-4.0\ide4\modules\autoload\ext\servlet-api-2.4.jar;C:\Program"
javadoc: Illegal package name:
"Files\netbeans-4.0\ide4\modules\autoload\ext\jsp-api-2.0.jar;web/WEB-INF/lib/hibernate2.jar;web/WEB-INF/lib/hsqldb.jar;web/WEB-INF/lib/jsf-api.jar"

These errors were generated while running on
Windows XP, because some of the paths in the
classpath contain "C:\Program Files".  The problem
is not Windows-specific though; I verified that
the same problem occurs on Linux if I add a
directory with a space in it to the classpath. 
It's just that Windows systems much more commonly
contain directories with spaces in their name.

The problem occurs because the javadoc-build
target in the web project version of
build-impl.xml passes the value of the
javac.classpath property to javadoc command as a
commandline argument, without surrounding it in
quotes.  The fix is simple.  Find this code in the
javadoc-build target

<condition property="javadoc.classpath.opt"
value="-classpath ${javac.classpath}">
    <not>
        <equals arg1="${javac.classpath}" arg2=""/>
    </not>
</condition>

Change the first line to:

<condition property="javadoc.classpath.opt"
value="-classpath &quot;${javac.classpath}&quot;">

To be really correct you'd need to also handle the
possiblity of paths contains a double quote
character.  All of this could be avoided by not
passing the classpath as part of a <arg line=""/>
element.
Comment 1 Jesse Glick 2005-01-01 17:44:37 UTC
This is the exact analogue of issue #50548 for web projects. Fix
should be very easy; see diff in j2seproject.
Comment 2 Radko Najman 2005-02-23 13:44:49 UTC
Fixed.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo