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.
On Windows XP, in the "Add Jar/Folder" dialog under Project Properties/Libraries, the path to a jar can only be specified as "Path from Variable" if the variable points exactly to the directory where the jar file is located. It cannot be used as a prefix with additional subdirectories which would result in {variable}/path/to/file.jar, only {variable}/file.jar. When trying, the text field shows <no suitable variable>. On Linux, it works as expected.
Very strange. I do not have Win box handy so I cannot test this. Looking at code I cannot see any obvious problem: selected java.io.File from JFileChooser is taken and its getAbsolutePath is tested if it starts with any of the getAbsolutePath of java.io.File of each variable. Can you see how this could get broken on your PC? What are concrete paths in your scenario? Perhaps I should normalize java.io.File before comparing their absolute paths. But even then it should get broken only in certain scenarios. Thanks. QA - could you test this please on Windows?
Your mentioning normalization rang a bell. I took care to capitalize the path components correctly as a mismatch in case can bite you in cross-platform tools, even if Windows doesn't care. I have experienced this several times. However, I used a lower case drive letter in the variable (d:\dev-java\lib) while the file chooser returns an upper case letter. I failed to notice that, presumably because drive letters are used on Windows only and case doesn't matter there! So, I experimented a bit. Using a capital drive letter works! If the file name components or the drive letter is incorrectly capitalized, it doesn't work, even though it means the same file on Windows. It could be a matter of taste if this should be considered a bug. I don't know if there is an easy way to "normalize" the file name in order to avoid this upper/lower case dependency. I ran into another bug which maybe has the same cause: While trying to edit the variable to change the drive letter to upper case, this change is first shown in the variables list, but when re-opening the variables dialog, the old value is displayed. Same for changes in case only for file name components. Should I submit this as another bug or can it be worked on here?
Yes I can reproduce this behavior - the case of drive letter is important and it is impossible to edit case of the drive letter directly
Thanks guys for the help. I will fix both problems you've identified. It it my mistake not to normalize java.io.File - we've had this problem before in other areas. In NB code base it is easy - there is FileUtil.normalizeFile() which does all the tricks.
Fixed locally as e85fe59b5245. Please verify on Windows once fix gets into build. Thanks.
Integrated into 'main-golden', will be available in build *200812121401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/e85fe59b5245 User: David Konecny <dkonecny@netbeans.org> Log: #154320 - normalize File before using it
I tested nightly build 200812150201, and it works for me! Thanks.
verified.
The fix has been ported into the release65_fixes repository. http://hg.netbeans.org/release65_fixes/rev/35829a98b272
verified in 6.5patch2