我试图在不使用 Windows 注册表的情况下使用 XML 中的 Java 首选项,但我看到了一条与注册表相关的消息 [英] I'm trying to use Java Preferences from XML WITHOUT using Windows registry, but I see a Registry-related message
问题描述
我有一个生成以下输出的简化程序,其中以 ^ 开头的行是由我的代码生成的.请注意,我故意删除了 HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft 中的 Prefs 键.
I have a simplified program that produces the following output, in which the lines starting with ^ are generated by my code. Note that I deliberately deleted the Prefs key in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft.
^ A preferences file was found
Aug 09, 2013 2:45:23 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002.
Windows RegCreateKeyEx(...) returned error code 5.
^ doallunconditionally: false
^ footnotespopup: false
^ thumbnailsgenerated: true
^ thumbnailwidth: 200
^ pathin: C:/Users/Das/Google Drive
^ pathout: C:/Users/Das/ottmar/site
^ pathlog: C:/Users/Das/ottmar/logs
我的问题是,我可以完全绕过注册表吗?我想我应该可以.
如果需要,我可以发布源代码(180 行).
My question is, can I bypass the registry entirely? I thought I should be able to.
I can post the source code (180 lines) if needed.
推荐答案
本页解释了如何使用 Windows 注册表之外的首选项存储:
This page explains how to use a preferences store apart from the Windows registry:
http://www.davidc.net/programming/java/java-preferences-using-file-backing-store
我没有尝试过,但它似乎相当简单.您也可以结帐:
I've not tried it but it seems to be fairly straightforward. You can also checkout:
有没有办法在 Windows 下使用 java.util.Preferences 而不使用注册表作为后端?
这篇关于我试图在不使用 Windows 注册表的情况下使用 XML 中的 Java 首选项,但我看到了一条与注册表相关的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!