At past time I’m faced with some unexpected behavior on windows environments. The issue occurs when I’m tried to execute java code which communicate with my windows machine: find-bugs maven plugin or IntelliJ IDEA
Symptom:
[java] WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(…) returned error code 5.
How to fix: create HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs and
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JavaSoft\Prefs keys
Detailed steps:
- Open regedit aplication (hint: Win+R -> type regedit -> press Enter)
- Navigate to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node
- Right click on
WOW6432Node folder, select New -> Key and type JavaSoft as new key - Create Prefs key within JavaSoft
- Repeat steps 3-4 for
HKEY_LOCAL_MACHINE\SOFTWARE key path
After above steps we will see this structure structure: