Java 首选项存储在 Mac OS X 上的什么位置?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/675864/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 17:45:11  来源:igfitidea点击:

Where are Java preferences stored on Mac OS X?

javamacospreferences

提问by avernet

On Windows, the Java preferences, which you access in your application from java.util.prefs.Preferences are stored in the registry. Where are those stored on Mac OS X?

在 Windows 上,您在应用程序中从 java.util.prefs.Preferences 访问的 Java 首选项存储在注册表中。那些存储在 Mac OS X 上的位置在哪里?

采纳答案by Todd Gamblin

From Apple Developer Connection:

来自Apple 开发者连接

The preferences files generated by the Preferences API are named com.apple.java.util.prefs. The user's preferences file is stored in their home directory (~/Library/Preferences/). The system preferences are stored in /Library/Preferences/and are only persisted to disk if the user is an administrator.

由 Preferences API 生成的首选项文件名为 com.apple.java.util.prefs. 用户的首选项文件存储在其主目录 ( ~/Library/Preferences/) 中。/Library/Preferences/如果用户是管理员,则系统首选项存储在磁盘中 并且仅保留在磁盘中。

回答by avernet

Also, note that if the preference is nested enough, it won't directly be in com.apple.java.util.prefs, but rather in its own file. For instance, if you have a node /a/b/c, the key/value pairs for that node will be stored in a.b.c.plist.

另外,请注意,如果首选项嵌套得足够多,则它不会直接位于 中com.apple.java.util.prefs,而是位于其自己的文件中。例如,如果您有一个节点/a/b/c,则该节点的键/值对将存储在a.b.c.plist.

The file will be either in ~/Library/Preferences/or /Library/Preferences/, as for the com.apple.java.util.prefsfile.

该文件将成为无论是在~/Library/Preferences//Library/Preferences/,作为com.apple.java.util.prefs文件。