Bug 1460814

Summary: /etc/.java/.systemPrefs directory missing
Product: [Fedora] Fedora Reporter: Robert Marcano <robert>
Component: java-1.8.0-openjdkAssignee: jiri vanek <jvanek>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 25CC: ahughes, dbhole, jerboaa, jvanek, msrb, mvala, omajid
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-13 11:02:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Robert Marcano 2017-06-12 20:39:05 UTC
Description of problem:

The default directory /etc/.java/.systemPrefs used for system preferences is missing. The RPM spec creates it (1) but it isn't found after installation, "rpm -ql" doesn't show it as part of any of the packages.

(1) https://src.fedoraproject.org/cgit/rpms/java-1.8.0-openjdk.git/tree/java-1.8.0-openjdk.spec?h=f25#n1763


Version-Release number of selected component (if applicable):

java-1.8.0-openjdk-1.8.0.131-1.b12.fc25.x86_64
java-1.8.0-openjdk-devel-1.8.0.131-1.b12.fc25.x86_64
java-1.8.0-openjdk-headless-1.8.0.131-1.b12.fc25.x86_64
java-1.8.0-openjdk-src-1.8.0.131-1.b12.fc25.x86_64


Additional info:

Fedora 24 package has the same problem. When this directory is not found, Java try ${java.home}/.systemPrefs and this break administrator defined system preferences when the package is updated.


Workaround:

Manually create the directory

Comment 1 jiri vanek 2017-06-13 15:53:37 UTC
so actually the only thing you need, is to make java rpms to own /etc/.java  oook?


As for additional info, when the directory do nto exists, then there is no admin setup, so java is doing right to use its own settings, or not?

Comment 2 Robert Marcano 2017-06-13 16:05:29 UTC
(In reply to jiri vanek from comment #1)
> so actually the only thing you need, is to make java rpms to own /etc/.java 
> oook?
> 

Yes, I think the default should be that. Administrators using applications that store system preferences using the Java API expect that when an update of the JVM is installed those preferences stay. Currently on a JVM update it doesn't find the preferences because they are on the old release ${java.home}/.systemPrefs.

> 
> As for additional info, when the directory do nto exists, then there is no
> admin setup, so java is doing right to use its own settings, or not?

IMHO The directory should exists by default so it doesn't store in ${java.home}. JVM updates on Fedora are not done on the same directory, every update create a new one like /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-1.b12.fc25.x86_64

I remember there where discussions about the hidden /etc/.java directory but I don't recall there was a decision to remove it. Maybe there was but I can't find references to it. Only other packages patched to not warn about it, like https://bugzilla.redhat.com/show_bug.cgi?id=770972

Comment 3 Robert Marcano 2017-06-13 17:03:18 UTC
Note: Java 8 checks for /etc/.java/.systemPrefs not only for /etc/.java

See http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/solaris/classes/java/util/prefs/FileSystemPreferences.java#l168