Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8223925

No document covering default property files and system properties of the Preferences API

XMLWordPrintable

        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

              jgordon Joni Gordon (Inactive)
              shadowbug Shadow Bug
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: