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.
I have created two projects that have their Working Directory properties (Tools->Options, the Debugging and Executing->ExecutionTypes->External Execution->Expert tab, the Debugger Execution->Expert tab and the Debugger Types->Default Debugging->Expert tab) set correctly but when executed or debugged are still executng in the NetBeans IDE directory. I'm sure I've tried all possible caveats listed in the NetBeans FAQ (I am running JDK 1.3.1_01 and that is the VM reported by NetBeans in the NetBeans About dialog's detail tab, my main class is set to use external execution, etc.). I have confirmed that the directory is not set by printing the System.getProperty("user.dir") value at startup. I have one project that I imported from my NetBeans 3.2.1 RC 2 settings that has these setting set properly that works correctly (runs from the execution directory that I have specified). I also understand that writing code that depends on such a directory setting is really nota good idea so I am submitting a related project change idea to my supervisor to hopefully circumvent the need for this in the future as suggested by the NetBeans FAQ. Here is the related NetBeans FAQ link on the concept: http://www.netbeans.org/articles/faqs/configuration.html#FAQ_41
I tried to set the working directory and then executed the ImageViewer from sampledir in Default project. Everything worked as expected. Please, do you see the same problems in this simple scenario on your side too? Thanks.
Additional comments (please add comments to the issue don't just reply to the emails from IssueZilla): No, still no-go. I performed the following steps: * Deleted my NetBeans 3.3 settings directory (I had deleted the Default project so I did this to "reset" things) * Started NetBeans 3.3 and imported my preferences from NetBeans 3.2.1RC2 (different personal directory, though, so I can still run NetBeans 3.2.1RC2 if I need to); Project Default is the starting project at startup * Added the imageviewer to the Project by right-clicking on "Project Default" and selecting Add Existing... * Right-clicked on the ImageViewer class and selected Tools->Set As Project Main Class. * Selected Tools->Options from the menu and set the following Properties (yes, D:\Downloads exists as a directory): Debugging and Executing Debugger Types Default Debugging (Expert Tab) Working Directory = D:\Downloads Execution Types External Execution (Expert Tab) Working Directory = D:\Downloads Debugger Execution (Expert Tab) Working Directory = D:\Downloads I then executed the project, which compiled the code and brought up the Image Viewer. I then selected File and Open and the current directory was D:\NetBeans-3.3\bin (the NetBeans runtime driectory). The same occurs when I debug the project. I also checked the Properties of the ImageViewer class. In the Expert tab the following is set: Compiler = External Compilation Debugger = Default Debugging Executor = External Execution I also tried this from scratch WITHOUT importing my settings and it still did not work. Thanks for the quick feedback on this, by the way. Voch
Next comment: I have more information on this problem as I have reproduced it on my boss' machine with one project working properly and another not working. My boss is running NetBeans 3.3 and has two projects: CodeDrop-1024 and CurrentBuild. The CodrDrop-1024 project has the following Tools->Options settings: Debugging and Executing Debugger Types Default Debugging (Expert Tab) Working Directory = D:\CodeDrop-1024 Execution Types External Execution (Expert Tab) Working Directory = D:\CodeDrop-1024 Debugger Execution (Expert Tab) Working Directory = D:\CodeDrop-1024 And the CurrentBuild project has these Tools->Options settings: Debugging and Executing Debugger Types Default Debugging (Expert Tab) Working Directory = D:\CurrentBuild Execution Types External Execution (Expert Tab) Working Directory = D:\CurrentBuild Debugger Execution (Expert Tab) Working Directory = D:\CurrentBuild He created the project CodeDrop-1024 first and set it up. It executes and debugs the project from the directories specified in the Tools->Options dialog properly. Next he created the project CurrentBuild. It executes and debugs the project INCORRECTLY setting the working directory to those of the the CodeDrop-1024 project. The values are consistent and seemingly saved properly when edited and retrieved in the Tools->Options dialog for both projects. If I may wager a guess I think either the executor/debugger is reading the information from the wrong project OR the Tools->Options dialog is reading and writing the infromation to and from the wrong project consistently and the executor/debugger is reading it properly. Voch
I again wasn't successful in reproduction. Anyway, is it possible to attach zipped {userdir}/system/Projects directory, so we can check saved settings. CCing Vita, he will know about settings stuff more.
Created attachment 3908 [details] content of Projects folder
I'm having this same problem. Windows XP, NetBeans 3.3 (b200112102331), Java 1.3.1. Creating a trivial class with a main which simply does... System.out.println(System.getProperty("user.dir")) ...shows the the "Working Directory" property of the "External Execution" > Expert tab has no effect on executing the class. A potentially relevant fact: I deleted the "Default Project" from the Project Manager a while back.
Target milestone -> 3.4
It works for me too. Attached userdir contains just Default project where the working directory is set as D:\Downloads for External Executor. Try to reproduce with the latest nb3.3.1 build, follow steps mentioned by Gordon and if the problem remains reopen the bug please.
Seems like this issue is occuring again: Here's more information from a customer: This occurs after an update (patch ) to version 3.0 that was installed via auto-update. Having read the bug report from the original report, I would suggest that the update is probably a red-herring and that this is an intermitent fault that I had just not encountered before. I would suggest that this bug is real, although not reproducable by you (I have opened some other projects that I had lying around and proved that they do not suffer from this problem). ========================================================== New update, working directory setting ignored by debgger. bin as the working directory, regardless of the setting of working directory in the project|settings|execution types|debugging|expert dialog. Executing the project works correctly and the execution types setting for working directory is the same. This problem did not exist before the latest update. I selected the working directory setting from the file selction dialog in all cases, so this is not a difficult to spot typing error.
Target milestone was changed from '3.4' to TBD.
Tested and seems, that works for me.
verified - it works fine in [nb_dev](20030728)