• Post Reply Bookmark Topic Watch Topic
  • New Topic

Could not open/create prefs warning  RSS feed

 
Marie Day
Greenhorn
Posts: 29
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this error mean, and also, when I get it, the command line hangs so that I can't do anything else (Is there a way to recover from that?).
I'm running Windows 7.

Jan 03, 2015 5:00:59 AM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0
x80000002. Windows RegCreateKeyEx(...) returned error code 5.
 
Knute Snortum
Sheriff
Posts: 4281
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess is that you don't have permissions to edit/write to the Windows Registry. Can you start a command line as Administrator?

If the program hangs, try Ctrl-C (hold the Ctrl key down and press C).

Is this your program? Can you post the code?
 
Marie Day
Greenhorn
Posts: 29
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I actually am logged in as Administrator. It's the only account on my Windows 7 machine. And I checked the control panel to make sure that it was actually labeled Administrator, and it is. However, when I run regedit and go to the permissions for JavaSoft, the "Full Control" box is checked for Administrator, but it's greyed out, so I can't change it. Which makes me wonder if I really am an Administrator.

I've tried "Switch User' from the Shut down button, and that just takes me back to the welcome screen with apparently no change (no account to change to).

There is a poster here, also on Windows 7, who got the identical error. I followed his instructions, but there was no "Full Control" box to click, because as I mentioned, it's already clicked.
http://www.coderanch.com/t/635066/java/java/Cannot-create-prefs-warning-on

But I'm wondering if the following could be my issue: the other poster says the path to the permissions on his machine is HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs
On my machine, it's HKEY_CURRENT_USER\SOFTWARE\JavaSoft\Prefs

I'm wondering if Java is looking for the permissions in the wrong place. Is there a way for me to check that?

Thanks in advance for any suggestions.

 
Marie Day
Greenhorn
Posts: 29
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, here's the code, from Head First Java. It plays a music note when you pass an integer for the instrument and
an integer for the note. I just want to clarify that the code runs correctly and also prints the error message.
Thanks for telling me about control C. It's been a long time since I've worked at the command line.

 
Tomas Linhart
Ranch Hand
Posts: 86
2
Java Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This would be the same problem as in another thread (link) on Javaranch. Check it out for the solution.
 
Marie Day
Greenhorn
Posts: 29
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm still getting the identical error message.

This seems to be the path that's needed:
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs

There was no JavaSoft under SOFTWARE, so I manually added it by right clicking on SOFTWARE, add-->key, and added JavaSoft.
Then I right clicked on JavaSoft, add--->key, and added Prefs.
I right clicked Prefs, went to Permissions, and made sure all 4 users on the list had the "Full Control" box checked. The list was: CREATOR OWNER, SYSTEM, Administrators, Users.
Then I rebooted. The CREATOR OWNER check box has reverted back to not checked. The check I added for Users is still there. System and Administrators already had a check before.
Still the same error message when I run the program.

I first tried this by adding only JavaSoft and hoping Java would create Prefs, but that didn't happen.

Maybe I'm adding the keys wrong?......
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!