Fix Java Windows Registry Warning

Evgeniy Fitsner Software Engineer
1 min read
Fix Java Windows Registry Warning

When executing Java code that communicates with the Windows machine — particularly when using the find-bugs Maven plugin or IntelliJ IDEA — you may encounter the following warning:

1
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(…) returned error code 5.

Solution

Create two registry keys:

  • HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs
  • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JavaSoft\Prefs

Steps to Fix

  1. Open the Registry Editor (Win + R → type regedit → Enter)
  2. Navigate to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node
  3. Right-click on WOW6432Node, select New → Key and name it JavaSoft
  4. Create a Prefs key within JavaSoft
  5. Repeat steps 3–4 for the HKEY_LOCAL_MACHINE\SOFTWARE path