This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 33836 - Cannot compile sources in directories with spaces
Summary: Cannot compile sources in directories with spaces
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
: 33021 34066 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-05-22 15:47 UTC by drzewo
Modified: 2007-09-26 09:14 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
TreeFS module that workarounds the problem (12.85 KB, application/octet-stream)
2003-06-03 17:28 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description drzewo 2003-05-22 15:47:28 UTC
NetBeans 3.5rc2 cannot compile sources located in
the directory with spaces (particularly examples
that come with netbeans, which are located on
Windows 2000/XP machines somewhere in
"<drive>:\Documents and
settings\<username>\.netbeans\4.5rc2\sampledir)
with any external compiler whenever any treefs
file system is mounted (with compile capability
turned on). 

To reproduce this bug simply:
1. mount any directory,
2. mount any subdirectory of this directory using
treefs, 3. try to compile (with some external
compiler) the default project examples on Windows
2000/XP machine (provided that your users home dir
is located in <drive>:\Documents and Settings\),
4. seat back, relax and watch the output of your
compiler, which should look something like:

[javac]
error: cannot read: C:\Documents; and
Settings\dominikd\.netbeans\3.5rc2\sampledir\examples\colorpicker\ColorPicker.java
1 error
Errors compiling ColorPicker.

[jikes]
C:/java/nb3.5rc2/..java [0:0] Semantic Caution:
The input file "C:/Documents; and
Settings/dominikd/.netbeans/3.5rc2/sampledir/examples/colorpicker/ColorPicker.java"
was not found.
Errors compiling ColorPicker.

Unsetting (disabling) the "use for compilation"
capability for the mounted treefs dir, prevents
this path from being appended to the classpath,
and compilation runs smooth.

I have also filed a bug report for treefs some
time ago
(http://treefs.netbeans.org/issues/show_bug.cgi?id=33021)

Config: win 2000/xp, j2sdk 1.4.2 beta, netbeans
3.5 rc2, treefs 1.20.1 (from alpha au)

regz,
/d
Comment 1 Marian Mirilovic 2003-05-22 16:42:31 UTC
it works fine without using "treefs" so reassigne to treefs for
investigation. IMHO it has not to be stopper for NB3.5/S1S5.
Comment 2 Jaroslav Tulach 2003-05-28 13:28:13 UTC
Radek, would you be so kind and helped me with this issue? I do not
have any Windows installed and I remember you solving similar issue once.

Dominik, which version of treefs you are using? Check log please.
Comment 3 drzewo 2003-05-28 14:19:43 UTC
treefs introduces itself in the log as:
org.netbeans.modules.treefs/2 [1.20.1 200305012350] 
I assume that is the latest binary version available via alpha AU.
Comment 4 Jaroslav Tulach 2003-05-28 14:29:10 UTC
1.20.1 and 1.21 are the latest also in CVS repository. Looks like we
really have to fix it ;-(
Comment 5 Jaroslav Tulach 2003-06-02 09:07:41 UTC
Report from issue 34066:

This is an issue with 3.5 RC3, and doesn't happen in RC1.  
I don't have a copy of RC2 to determine if it exists in 
RC2.  

Filesystem-A has a path with a space ("C:\Projects\My 
Project")
Folder of Filesystem-A is remounted as Filesystem-B using 
the "View over a filesystem" module.
When trying to compile anything in Filesystem-A (I'm not 
confusing it with Filesystem-B, the issue is with the 
parent of the remounted folder, not the remounted folder) 
it fails with the message:

error: cannot read: C:\Projects\My; Project\Myfile.java

Note the semicolon.  I have no idea where that semicolon 
is coming from.  But the issue clears itself up if I do 
any of the following:
Unmount Filesystem-B
Disable "View over a filesystem" (which essentially 
unmounts Filesystem-B)
Switch back to RC1

Comment 6 Jaroslav Tulach 2003-06-02 09:07:56 UTC
*** Issue 34066 has been marked as a duplicate of this issue. ***
Comment 7 Jaroslav Tulach 2003-06-02 09:09:00 UTC
*** Issue 33021 has been marked as a duplicate of this issue. ***
Comment 8 Jaroslav Tulach 2003-06-02 09:23:51 UTC
Is very likely windows specific. I need to get a grip on windows
machine or you guys may help me running with -J-DIDE-Exec=-5 and
attaching the lines from log starting with [IDE-Exec].
Comment 9 drzewo 2003-06-02 10:11:04 UTC
Here is the output (compilation with javac, fastjavac and jikes
respectively):

[IDE-Exec] Executing:
0 .= C:\java\j2sdk1.4.2\bin\javac
1 .= -g
2 .= -classpath
3 .= C:\Documents and
Settings\dominikd\.netbeans\3.5rc3\system;C:\Documents and
Settings\dominikd\.netbeans\3.5rc3\system;C:\java\nb3.5rc3\system;C:\java\nb3.5rc3\modules\ext\AbsoluteLayout.jar;C:\java\nb3.5rc3\modules\ext\junit-3.8.1.jar;C:\java\nb3.5rc3\modules\ext\junit-testrunner.jar;C:\java\nb3.5rc3\modules\autoload\ext\servlet-2.3.jar;C:\java\nb3.5rc3\lib\ext\xml-apis-1.0b2.jar;C:\Documents
and
Settings\dominikd\.netbeans\3.5rc3\sampledir;C:\java\nb3.5rc3\beans\TimerBean.jar;C:\Documents
and Settings\dominikd\.netbeans\3.5rc3\sampledir\examples\texteditor";
C:\Documents;
4 .= and
5 .=
Settings\dominikd\.netbeans\3.5rc3\sampledir\examples\colorpicker\ColorPreview.java

[IDE-Exec] Executing:
0 .= C:\java\nb3.5rc3\modules\bin\fastjavac\fastjavac.exe
1 .= -g
2 .= -jdk
3 .= C:\java\j2sdk1.4.2
4 .= -classpath
5 .= C:\Documents and
Settings\dominikd\.netbeans\3.5rc3\system;C:\Documents and
Settings\dominikd\.netbeans\3.5rc3\system;C:\java\nb3.5rc3\system;C:\java\nb3.5rc3\modules\ext\AbsoluteLayout.jar;C:\java\nb3.5rc3\modules\ext\junit-3.8.1.jar;C:\java\nb3.5rc3\modules\ext\junit-testrunner.jar;C:\java\nb3.5rc3\modules\autoload\ext\servlet-2.3.jar;C:\java\nb3.5rc3\lib\ext\xml-apis-1.0b2.jar;C:\Documents
and
Settings\dominikd\.netbeans\3.5rc3\sampledir;C:\java\nb3.5rc3\beans\TimerBean.jar;C:\Documents
and Settings\dominikd\.netbeans\3.5rc3\sampledir\examples\texteditor";
C:\Documents;
6 .= and
7 .=
Settings\dominikd\.netbeans\3.5rc3\sampledir\examples\colorpicker\ColorPreview.java

[IDE-Exec] Executing:
0 .= jikes
1 .= +E
2 .= -g
3 .= -classpath
4 .=
C:\java\j2sdk1.4.2\jre\lib\rt.jar;C:\java\j2sdk1.4.2\jre\lib\sunrsasign.jar;C:\java\j2sdk1.4.2\jre\lib\jsse.jar;C:\java\j2sdk1.4.2\jre\lib\jce.jar;C:\java\j2sdk1.4.2\jre\lib\charsets.jar;C:\Documents
and Settings\dominikd\.netbeans\3.5rc3\system;C:\Documents and
Settings\dominikd\.netbeans\3.5rc3\system;C:\java\nb3.5rc3\system;C:\java\nb3.5rc3\modules\ext\AbsoluteLayout.jar;C:\java\nb3.5rc3\modules\ext\junit-3.8.1.jar;C:\java\nb3.5rc3\modules\ext\junit-testrunner.jar;C:\java\nb3.5rc3\modules\autoload\ext\servlet-2.3.jar;C:\java\nb3.5rc3\lib\ext\xml-apis-1.0b2.jar;C:\Documents
and
Settings\dominikd\.netbeans\3.5rc3\sampledir;C:\java\nb3.5rc3\beans\TimerBean.jar;C:\Documents
and Settings\dominikd\.netbeans\3.5rc3\sampledir\examples\texteditor";
C:\Documents;
5 .= and
6 .=
Settings\dominikd\.netbeans\3.5rc3\sampledir\examples\colorpicker\ColorPreview.java

My config:
-------------------------------------------------------------------------------
>System Info: 
  Product Version       = NetBeans IDE 3.5 RC3 (Build 200305282350)
  IDE Versioning        = IDE/1 spec=3.42.1 impl=200305282350
  Operating System      = Windows 2000 version 5.0 running on x86
  Java; VM; Vendor      = 1.4.2-beta; Java HotSpot(TM) Client VM
1.4.2-beta-b19; Sun Microsystems Inc.
  Java Home             = C:\java\j2sdk1.4.2\jre
  System Locale; Encod. = pl_PL; Cp1250
  Home Dir; Current Dir = C:\Documents and Settings\dominikd;
C:\java\nb3.5rc3
  IDE Install; User Dir = C:\java\nb3.5rc3; C:\Documents and
Settings\dominikd\.netbeans\3.5rc3
  CLASSPATH             =
C:\java\nb3.5rc3\lib\ext\boot.jar;C:\java\nb3.5rc3\lib\ext\crimson-1.1.3.jar;C:\java\nb3.5rc3\lib\ext\regexp-1.2.jar;C:\java\nb3.5rc3\lib\ext\xerces-2.0.2.jar;C:\java\nb3.5rc3\lib\ext\xml-apis-1.0b2.jar;C:\java\j2sdk1.4.2\lib\dt.jar;C:\java\j2sdk1.4.2\lib\tools.jar
  Boot & ext classpath  =
C:\java\j2sdk1.4.2\jre\lib\rt.jar;C:\java\j2sdk1.4.2\jre\lib\i18n.jar;C:\java\j2sdk1.4.2\jre\lib\sunrsasign.jar;C:\java\j2sdk1.4.2\jre\lib\jsse.jar;C:\java\j2sdk1.4.2\jre\lib\jce.jar;C:\java\j2sdk1.4.2\jre\lib\charsets.jar;C:\java\j2sdk1.4.2\jre\classes;C:\java\j2sdk1.4.2\jre\lib\ext\dnsns.jar;C:\java\j2sdk1.4.2\jre\lib\ext\kunststoff.jar;C:\java\j2sdk1.4.2\jre\lib\ext\ldapsec.jar;C:\java\j2sdk1.4.2\jre\lib\ext\localedata.jar;C:\java\j2sdk1.4.2\jre\lib\ext\sunjce_provider.jar
  Dynamic classpath     =
C:\java\nb3.5rc3\lib\core-windows.jar;C:\java\nb3.5rc3\lib\core.jar;C:\java\nb3.5rc3\lib\openide.jar
-------------------------------------------------------------------------------
	org.netbeans.modules.treefs/2 [1.20.1 200305212350] 
Comment 10 rmatous 2003-06-02 13:02:12 UTC
There seems to be problem in class
org.netbeans.modules.java.JExternalCompilerGroup$JFormat
its format methods incorrectly adds ; into the string name of file to
compile.
Comment 11 Jaroslav Tulach 2003-06-02 14:34:14 UTC
This behaviour can be reproduced without TreeFS by starting NetBeans
with a -cp argument providing a directory with a space and backslash
at the end. 

I have succeeded by modifying the external executor command line to
directly add there a backslash entry before the {files} argument.
Comment 12 rmatous 2003-06-02 14:52:02 UTC
Review line comment: // if (slashed) { ...error... }??? in method
getClassPathEntriesEnd in
org.netbeans.modules.java.JExternalCompilerGroup$JFormat. 

Comment 13 Jan Becicka 2003-06-03 10:10:17 UTC
I tried 
runide -cp:a "c:\documents and settings\"
and I'm still able to compile
Comment 14 rmatous 2003-06-03 10:14:22 UTC
Did you compile sources from "c:\documents and settings\" ?
Comment 15 Jan Becicka 2003-06-03 10:26:58 UTC
What I did was:
runide -cp:a "C:\Documents and Settings\jbecicka\.netbeans\3.5\sampledir\"

And then I did build all on sampledir.
And it works.
Comment 16 Jan Becicka 2003-06-03 16:31:42 UTC
This is not P1 IMHO (Regardless I'm not able to reproduce it).
Workaround is simple: do not add "\" at the end of the classpath.

Jardo, are you still able to reproduce it not having treefs installed?
If not, I suggest to reassign it back to treefs module.

Comment 17 Jaroslav Tulach 2003-06-03 17:16:35 UTC
It is possible to reproduce it. Select external compiler, it
properties and change the command line to contain directly the path
containing \:

{classpath};c:\Some Space\ {files}

then the compilation will fail. Of course I agree that the workaround
is simple and will do it in treefs. But keep this bug in Java, as it
is clear a regression.
Comment 18 Jaroslav Tulach 2003-06-03 17:28:43 UTC
Created attachment 10574 [details]
TreeFS module that workarounds the problem
Comment 19 drzewo 2003-06-04 08:08:18 UTC
treefs 1.22 fixes the problem for me. All external compilers (javac,
jikes and fastjavac) work fine both for the paths with spaces on the
classpath as well as in files to be compiled. Shouldn't the *real* fix
go to the java module
(org.netbeans.modules.java.JExternalCompilerGroup$JFormat)?
Comment 20 Jaroslav Tulach 2003-06-04 09:56:00 UTC
The real fix should go there, but it will only in main trunk. It will
be hard to get it into release 35. TreeFS on the other hand has no
problems to release an update as it is not restricted by release35
rules (still only on beta AU).

I am going to request an update the treefs.nbm on AU centers to 1.22
Comment 21 Jan Becicka 2003-06-05 11:55:15 UTC
This bug is not a regression. I can reproduce 
it in 3.4.1. 

Problem with treefs module is fixed and I 
think, we can lower priority to P3.
Comment 22 Jan Becicka 2004-06-23 09:05:32 UTC
NB 4.0 has completely new ant based build system. This issue is no
more valid.