[ACCEPTED]-Preference API storage-preferences
Accepted answer
For Windows systemRoot and userRoot are 4 stored in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs and HKEY_CURRENT_USER\Software\JavaSoft\Prefs respectively.
For Unix systemRoot 3 and userRoot are stored in "/etc/.java" and "${user.home}/.java/.userPrefs", respectively.
Note 2 that for Unix the locations can be changed 1 by specifying "java.util.prefs.userRoot" and "java.util.prefs.systemRoot" properties
I have to extend n002213fs' answer, because 3 it seems to me, that the Storage Location 2 is a big mess. Note that Windows saves it 1 in the Windows Registry and Unix saves it in prefs.xml-files.
userRoot
- Windows (32Bit):
HKEY_CURRENT_USER\Software\JavaSoft\Prefs
- Windows (64Bit) with JVM (64Bit):
HKEY_CURRENT_USER\Software\JavaSoft\Prefs
- Windows (64Bit) with JVM (32Bit):
HKEY_CURRENT_USER\Software\Wow6432Node\JavaSoft\Prefs
- Unix:
System.getProperty("java.util.prefs.userRoot")
or (if the previous value is not set)~/.java/.userPrefs
systemRoot
- Windows (32Bit):
HKEY_LOCAL_MACHINE\Software\JavaSoft\Prefs
- Windows (64Bit) with JVM (64Bit):
HKEY_LOCAL_MACHINE\Software\JavaSoft\Prefs
- Windows (64Bit) with JVM (32Bit):
HKEY_LOCAL_MACHINE\Software\Wow6432Node\JavaSoft\Prefs
- Unix:
System.getProperty("java.util.prefs.systemRoot")
or (if the previous value is not set)System.getProperty("java.home")+"/.systemPrefs"
(System.getProperty("java.home")
might be/etc/.java/
. You can check it in a terminal with$JAVA_HOME
.)
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.