FULL PRODUCT VERSION :
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows 7
Windows 8
Windows 10
A DESCRIPTION OF THE PROBLEM :
This is a continuation of Bug JDK-8139507 which has not been resolved:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8139507
Any java console tool that uses the Preferences API confuses users with warnings like this:
Oct 17, 2015 7:49:07 AM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002.
Windows RegCreateKeyEx(...) returned error code 5.
The issue is caused by WindowsPreferences initializing the systemRoot and userRoot in the constructor, even when only userRoot is used in the application.
For more details please see the original bug report:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8139507
I can reproduce this issue on my Windows 10 machine.
And users of my application can consistently reproduce the issue (and be confused by what it means):
https://www.filebot.net/forums/search.php?keywords=java.util.prefs.WindowsPreferences
It might not be a big issues, but this is a valid, easy to reproduce issue, so just closing & ignoring the issue is not acceptable. A quick Google search for "Could not open/create prefs root node Software\JavaSoft\Prefs at root" shows that this issue is affecting a large amount of people, especially end users who are confused by the message.
This is certainly NOT "Not an Issue" so please fix the problem, instead of closing related bug reports.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8139507
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
If Preferences systemRoot is never used in the application, there should not be any errors or warnings related to not being able to access/write to Preferences systemRoot.
ACTUAL -
See:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8139507
ERROR MESSAGES/STACK TRACES THAT OCCUR :
See:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8139507
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
See:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8139507
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Running the java application as Administrator, this giving the process permission to access the systemRoot parts of the registry, resolves the problem.