Search code examples
javaexceptionpreferencesstore

Saving/getting preferences using java.util.prefs.Preferences causes BackingStoreException


After declaring

private static Preferences systemPrefs = Preferences.systemNodeForPackage (SomeClass.class);

, either one of these lines of code:

String someString = systemPrefs.put("someKey", "someValue");

String someString = systemPrefs.get("someKey", "someDefaultValue");

causes this error, which repeats itself over and over during the rest of the program execution:

java.util.prefs.FileSystemPreferences syncWorld VARNING: Couldn't flush system prefs: java.util.prefs.BackingStoreException: /etc/.java/.systemPrefs/edu create failed.

I suspect there is some kind of security issue somewhere.

Could it be that this problem is specific to this computer for some reason? Could there be some other reason for this?


Solution

  • You need root privileges to update the system-level preferences. Normal users should only be able to update user-level preferences.