gpt4 book ai didi

java - 如何修复 "Prefs file removed in background/home/steven/.java/.userPrefs/prefs.xml"错误?

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:25:52 34 4
gpt4 key购买 nike

我的大部分程序都是在 Windows 上编程的,在首选项方面没有任何问题。我刚刚启动了 Ubuntu 12.04 并将我的类加载到 Eclipse 中。在运行时,我在控制台中收到:

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

我知道这与 Ubuntu 上的 preferences 系统有关,但是几次 Google 搜索都没有找到解决方案。谁能帮我解决这个错误?

最佳答案

您可能受到此错误的影响: https://bugs.openjdk.java.net/browse/JDK-8068373

(prefs) FileSystemPreferences writes \0 to XML storage, causing lossof all preferences

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

The XML writer happily writes the \0 into the file. I think it escapesit, but as already mentioned, this is pointless. Then later, when youtry to read it back in, the XML file is invalid. You get a warning onthe logs about the preferences file being invalid and all yourpreferences are wiped.

ADDITIONAL OS VERSION INFORMATION:

Occurs on allflavours of Linux we have tested. Issue is also reproducible on anyplatform if you deliberately use this PreferencesFactory.

You 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

解决方案:更新到 Java 9+

关于java - 如何修复 "Prefs file removed in background/home/steven/.java/.userPrefs/prefs.xml"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12869089/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com