JDK-8223925 : No document covering default property files and system properties of the Preferences API
  • Type: Bug
  • Component: docs
  • Affected Version: 7,8,11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-05-15
  • Updated: 2019-11-29
  • Resolved: 2019-08-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 8
11Fixed 13Fixed 8u241Fixed
Related Reports
Relates :  
Description
The preferences API stores data in /etc/.java/.systemPrefs by default before 
JDK 1.4.1.  JDK 1.4.2 and above uses JAVA_HOME/.java/.systemPrefs, but the 
JVM tries to look at /etc/.java/.systemPrefs first if it is available in the 
running environment.  This behavior could cause an unexpected result where 
multiple JDK are installed in the same machine.  This case is likely to 
happen since /etc/.java/.systemPrefs is created at the initial JDK 
installation. 

In order to avoid multiple JDK reading/writing property data from/into the 
same file, the system properties java.util.prefs.systemRoot and 
java.util.prefs.userRoot are supported to identify the root directory of 
property files for storing data.  While it is not documented anywhere 
JDK 1.5 used to have a dedicated detail document for the 
preferences API. 
 https://docs.oracle.com/javase/1.5.0/docs/guide/preferences/index.html 

The following two items should be clearly mentioned in the Java doc. 
1. Default property files and its priority - /etc/.java/.systemPrefs and JAVA_HOME/.java/.systemPrefs 
2. System properties - java.util.prefs.systemRoot and java.util.prefs.userRoot 
Comments
Added the existing Preferences API information to the JDK 13 Core Libs doc. Added the requested information about the default backing store as a Q&A in the Design FAQ section. Reviewed and approved by engineeing.
16-08-2019