How to fix the file "Prefs removed in the background /home/steven/.java/.userPrefs/prefs.xml"?

I programmed in Windows for most of my programs with no configuration issues. I just downloaded Ubuntu 12.04 and loaded my classes in Eclipse. At runtime, I get this in the console:

Oct 12, 2012 8:14:38 PM java.util.prefs.FileSystemPreferences$6 run WARNING: Prefs file removed in background /home/steven/.java/.userPrefs/prefs.xml 

I understand that this has something to do with the preferences system on Ubuntu, but several Google searches did not result in a lack of solutions. Can someone help me on how I can fix such an error?

+7
source share
1 answer

This error may have caught you: https://bugs.openjdk.java.net/browse/JDK-8068373

(prefs) FileSystemPreferences writes \ 0 to the XML store, causing the loss of all preferences

If you call prefs.put(key, "some string with \0 in it") ...

The XML writer happily writes \0 to a file. I think this is slipping away, but as already mentioned, it is pointless. Then, when you try to read it back, the XML file is invalid. You get a warning about the logs about an invalid settings file and all your preferences are erased.

ADDITIONAL INFORMATION ABOUT OS VERSION:

Occurs on all the flavors of Linux that we tested. The problem also reproduces on any platform if you intentionally use this PreferencesFactory.

You will also get the following output on stderr:

 Dec 29, 2014 9:19:19 AM java.util.prefs.FileSystemPreferences$6 run WARNING: Invalid preferences format in /Users/daniel/.java/.userPrefs/com/acme/testing/prefs.xml Dec 29, 2014 9:19:19 AM java.util.prefs.FileSystemPreferences$6 run WARNING: Prefs file removed in background /Users/daniel/.java/.userPrefs/com/acme/testing/prefs.xml 
+1
source

All Articles