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.
NbPreferences provides an implementation of Preferences which adds the flexibility to use userDir passed by a command line option for example. Preferences class only uses either the user's home directory (e.g. /home/<user>/.java/.userPrefs) to store the preferences, or system's directory (e.g. /etc/.java/.systemPrefs) to store system preferences. However, NbPreferences has not an equivalent importPreferences() method, hence it inherits Preferences' importPreferences() method, which unfortunately calls XmlSupport.importPreferences(), which ignores userDir and uses the standard userPrefs (Preferences.userRoot) or systemPrefs (Preferences.systemRoot) instead. This results in a FileNotFoundException if you use NbPreferences to store the Preferences in userDir, because Preferences.importPreferences() ignores looking to userDir.