-
Bug
-
Resolution: Fixed
-
P3
-
7, 8, 11
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8229833 | 11 | Joni Gordon | P3 | Resolved | Fixed | |
JDK-8229843 | 8u241 | Joni Gordon | P3 | Resolved | Fixed | b01 |
JDK-8235115 | emb-8u241 | Raymond Gallardo | P3 | Resolved | Fixed | team |
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
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
- backported by
-
JDK-8229833 No document covering default property files and system properties of the Preferences API
- Resolved
-
JDK-8229843 No document covering default property files and system properties of the Preferences API
- Resolved
-
JDK-8235115 No document covering default property files and system properties of the Preferences API
- Resolved
- relates to
-
JDK-4751177 Preferences storage placed unavailable to non-root users
- Closed