Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 50548 - [40cat] Javadoc on Windows using explicit JDK throws exceptions when folder names have spaces
[40cat] Javadoc on Windows using explicit JDK throws exceptions when folder n...
Product: java
Classification: Unclassified
Component: Project
PC Windows XP
: P3 (vote)
: 4.x
Assigned To: Tomas Zezula
: 51010 (view as bug list)
Depends on:
Blocks: 46901
  Show dependency treegraph
Reported: 2004-10-18 11:09 UTC by llturro
Modified: 2006-03-24 10:06 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description llturro 2004-10-18 11:09:44 UTC
[ BUILD # : Beta 2 ]
[ JDK VERSION : J2SE 1.5.0 ]

This is new. I remember creating javadoc with 
NB4.0. But now, under XP --in Linux works fine--, 
"Archivos de programa" (Program files) and
"Documents and Settings" create this error lines:

At top:
javadoc: Illegal package name:
javadoc: Illegal package name:
javadoc: Illegal package name: 

At bottom:
javadoc: warning - No source files for package de
javadoc: warning - No source files for package and
javadoc: warning - No source files for package and

Notice that package "de" belongs to "Archivos de
programa" and package "and" to "Documents and 

NB4.0 runs under jdk1.5, but the project uses 
j2sdk1.4.2_06. If I change project's platform to 
jdk1.5 then javadoc is generated without errors.
Comment 1 Jan Pokorsky 2004-10-18 13:00:06 UTC
Missing quotations in build script? Reassing to java/project for
Comment 2 Jesse Glick 2004-10-18 20:52:05 UTC
Sorry, don't think we can fix without either rebreaking issue #46901
or putting in Windows-specific hacks (e.g. adding artificial '"'
characters) that will break build scripts on other platforms. In fact
the build script code is strictly speaking correct as far as I can
tell - passes <arg file="..."/>, not <arg line="..."/> - but IIRC
Windows has no uniform way of handling quoting (it is done by
receiving process, not a shell).

On Windows it is always safer to use directory names without spaces
due to this class of problem.

Or as a workaround you can override the javadoc target from
build-impl.xml to work like the version you get when you use the
default platform. Since your target JDK is earlier than the IDE's JDK,
this should work OK.
Comment 3 llturro 2004-10-19 10:01:18 UTC
Hi Jesse, as I said in the first post, there is an easy workaround:
Change project's platform to Default Platform before generating Javadoc.

Anyway I think it should be worth fixing this problem. Not pressing,
but this case would span widely now that Java 1.5 as been released. It
would be normal running NB4.0 under 1.5 while compiling projects with
older versions. That's why NB4.0 allows so easily exchanging
platforms! It would be hard explaining that Javadoc can't be generated
(unless using a workaround) in case you used NB4.0 defaults, that is,
installation folder and project saving.

If you don't agree I'll accept it.

BTW, I already changed project's location (to a path without spaces),
but installation's default still doesn't let me creating Javadoc. This
could lead changing installation's default, don't you thing?
Comment 4 Jesse Glick 2004-10-19 16:45:40 UTC
Not a question of whether it is *worth* fixing; question of whether it
*can* be fixed. As far as I know, it can't, until Ant is fixed.

Re. default project dir - there is no really appropriate default on
Windows. Cf. issue #50143. Best is always to pick your own location
for sources, preferably in some place with a simple folder name (no
spaces, non-ASCII chars, etc.).
Comment 5 llturro 2004-10-19 16:53:29 UTC
Yes, but as I said, I already changed project's location and still
fails. The reason is default NB4.0 install directory. Users
downloading JDK 1.5 + NetBeans 4.0 Bundle, under Windows and compiling
projects with J2SDK 1.4.x wont be able to create Javadocs.
Comment 6 Jesse Glick 2004-10-19 17:58:20 UTC
What about the NB install directory? Where is that being used in the
Javadoc command?
Comment 7 llturro 2004-10-19 18:22:20 UTC
See original post, lines at top. It refers to a servlet API at
"Archivos de
and I didn't put it there.
Comment 8 Jesse Glick 2004-10-19 18:56:15 UTC
So you're using a web project? In that case if you installed NB in a
project dir w/ spaces you would (I guess) need to change the classpath
for the 'servlet24' library (or whatever it's called) to be some
absolute location.

Maybe Tomas can find some fix that works on Windows. I don't know. May
be a reportable bug in Ant, if it is failing to add '"' around
arguments containing spaces when using <exec>, and adding such quotes
would be the correct behavior for all executables. (Somehow it works
for the <javadoc> task.) Someone with a better knowledge of Windows
process semantics would need to investigate further.
Comment 9 llturro 2004-10-19 19:12:15 UTC
There are other libraries (at ide4/modules/autoload/ext) and their
purpose is unknown to me. Some come as standard libraries in clean
NB4.0 installation (see Java Library Manager and those jar at
jar:nbinst:///...). Am I supposed to change them to another location?

Extending AbsoluteLayout will lead to the same problem, and I suppose
future releases with EJB support will place their libraries there too.
Comment 10 Jesse Glick 2004-10-19 19:19:38 UTC
Yes, I am just pointing out that as one workaround it should be
possible to adjust library locations. Better however to install NB in
a directory without spaces to begin with.
Comment 11 Tomas Zezula 2004-10-20 13:41:55 UTC
The libraries rewrites the nbinst protocol into as
absolute path. The libraries framework can not fix this issue. But I
will try to get some Windows box to see what happens on it.
Comment 12 Jesse Glick 2004-10-20 19:32:30 UTC
Well I don't think there's anything wrong with the libraries module.
It's just the workaround for issue #46901 that can't (apparently)
handle spaces, TBD why.
Comment 13 Tomas Zezula 2004-10-20 19:38:51 UTC
I will try to look at it on Windows.
Comment 14 Tomas Zezula 2004-10-22 14:54:35 UTC
I've tried it on Windows and I've found that the problem is that the
javadoc classpath is passed as a line argument. If it is changed to a
path argument it works fine even when the project is in folder with
spaces. But the path argument can't be an empty path, there is a
problem when the javac.classpath is empty. It can be solved either by
regenerating the build-impl.xml when there is an explicit platform and
classpath changes from empty to non empty and vice versa. Or create
two conditional javadoc targets, one when javac.classpath is empty and
one when there is a javac.classpath. But both these solutions are ugly.
Jesse, do do you have any idea?
Comment 15 Jesse Glick 2004-10-22 20:37:50 UTC
Yes, that's the explanation. I forgot about the javadoc.classpath.opt

(Should Ant on Windows pass "" for an empty argument?)

Maybe try:

<path id="javac.classpath">
    <pathelement path="${javac.classpath}"/>
    <pathelement location="dummy"/>
<arg value="-classpath"/>
<arg pathref="javac.classpath"/>

to force the classpath argument to be nonempty? Also ugly but simpler.
Comment 16 Tomas Zezula 2004-10-25 14:54:34 UTC
Checking in
 <--  build-impl.xsl
new revision: 1.39; previous revision: 1.38
Comment 17 Jesse Glick 2004-11-01 20:48:07 UTC
*** Issue 51010 has been marked as a duplicate of this issue. ***
Comment 18 llturro 2004-11-03 14:27:50 UTC
As for QBuild 200411020931, Javadoc generates correctly when NetBeans
4.0 is installed under "Archivos de programa".
Comment 19 Jesse Glick 2005-01-01 17:45:13 UTC
Still broken for web projects: issue #52834.

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