Java on Windows 10 Issue: “Could not open/create prefs root node”

I was getting the following error message when I would run a Java application on my new Windows 10 Pro PC:

Nov 21, 2019 3:57:37 PM 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.

I searched the internet regarding the error message, people say it is a known bug and you need to manually create the following Windows registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs

When I opened the RegEdit, I found that the key already exists.

After a little more searching on the internet, I came across another comment that says you also need the following Windows registry key:

HKEY_LOCAL_MACHINE\Software\WOW6432Node\JavaSoft\Prefs

So, I opened the RegEdit and found the key did not exist. I created it and then the error message went away.

Hence, for future users who encounter this error message, create a text file called javasoft_prefs.reg and put the following in it:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs]

[HKEY_LOCAL_MACHINE\Software\WOW6432Node\JavaSoft\Prefs]

Now start RegEdit and click File – > Import and select the javasoft_prefs.reg file and the error message will go away.

Or you can run RegEdit from the Command Line and pass the file name as a parameter:

regedit  javasoft_prefs.reg

Regards,
Roger Lacroix
Capitalware Inc.

This entry was posted in Java, Programming, Windows.

Comments are closed.