If I use the Preference API to store user or system preferences, where are they stored on Windows and Unix?
The Preferences API enables applications to manage preference and configuration data. Applications require preference and configuration data to adapt to the needs of different users and environments.
The user preferences are typically stored at user-home/. java/. userPrefs . The user preferences location can be overridden by setting the system property java.
A node in a hierarchical collection of preference data. This class allows applications to store and retrieve user and system preference and configuration data. This data is stored persistently in an implementation-dependent backing store.
The userprefs. xml file contains a series of ParameterName elements that contain a ParameterValue element. The names of the parameters you can set are contained in the ParameterName elements. Enter the value for these parameters in the associated ParameterValue elements.
For Windows systemRoot and userRoot are stored in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs and HKEY_CURRENT_USER\Software\JavaSoft\Prefs respectively.
For Unix systemRoot and userRoot are stored in "/etc/.java" and "${user.home}/.java/.userPrefs", respectively.
Note that for Unix the locations can be changed by specifying "java.util.prefs.userRoot" and "java.util.prefs.systemRoot" properties
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With