Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot create prefs warning on Windows.  RSS feed

 
Jaspreet Saran
Greenhorn
Posts: 8
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everybody,
I have one problem with this app, not related to this whole thread of discussion , but i m not creating new post , i think problem is not big one.
when I run the following code from Java HeadFirst, everything goes fine but along with one error ( i don't know is it an error or exception, or some other windows stuff)
The code is


and what i got on cmd ( I am using Windows 7) :

Jaspreet javac ExceptionHandling.java

Jaspreet java ExceptionHandling
Jun 11, 2014 5:19:40 PM 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.

we got the sequencer


***************
What is meant by code in blue?
I know its some message from windows os and not from jvm. but i didn't understand it. please explain me....
Thanks to javaRanch and its team members.
 
Giovanni Montano
Ranch Hand
Posts: 397
6
Android Open BSD Slackware
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaspreet Saran wrote:hello everybody,
I have one problem with this app, not related to this whole thread of discussion , but i m not creating new post , i think problem is not big one.

Jaspreet java ExceptionHandling
Jun 11, 2014 5:19:40 PM 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.

we got the sequencer



I would try this, but do back up could not work. just found in google, have no clue if it is going to work

•Go into your Start Menu and type regedit into the search field.
•Navigate to the following path •HKEY_LOCAL_MACHINE\Software\JavaSoft

•Right click on the JavaSoft folder and click on New -> Key
•Name the new Key Prefs and everything should work.
 
Campbell Ritchie
Sheriff
Posts: 55329
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaspreet Saran wrote: . . . not related to this whole thread of discussion , but i m not creating new post . . .
But I am. You should always start a new thread for a new question, so I shall create a new thread.
 
Jaspreet Saran
Greenhorn
Posts: 8
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Giovanni Montano

it works but with very small change, when i made the key Prefs, windows prompt that it already exist somewhere.
I found that it is here: HKEY_USERS\S-1-5-21-2986116552-1422457668-3418972334-1000\Software\JavaSoft\Prefs

but I made a key in the path you specified, and named it as 'prefs' not as 'Prefs'. [ all in small ]
It works and now I am not getting any warning.

here is the full story for Java HeadFirst Readers. It might help you in case you too got this warning :

Especially with Windows 7, the JVM has not by default the permission to write into the Windows registry where the backing store for java.util.prefs.preferences is located under MS-Windows.
When executing either the ReverseXSL transformer, or even the Regex tester program, one can get errors like: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx
This does prevent registering a license. It does not prevent the software to perform transformations in the free software mode.
Fixing the issue is simply a matter of granting the necessary permissions to the registry root key at stake.
Run regedit.exe as administrator (regedit.exe is located in the c:\Windows operating system root directory).
Go to key HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs.
Right click to set permissions. Check a mark in the Full Control check box for the user(s) that need executing the reverseXSL software.
 
Giovanni Montano
Ranch Hand
Posts: 397
6
Android Open BSD Slackware
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaspreet Saran wrote:Thanks Giovanni Montano

thanks to the search engine not me(or better my nick name)

head first is pretty cool but I would recommend you to consult different sources, there are some points I also understand with other books, tutorials, video etc.
I mean the only problem is to select the information, not the lack of it
 
Campbell Ritchie
Sheriff
Posts: 55329
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it was a search engine, please quote the link where you found the solution. That would help in case it occurs again, and we can inspect the link ourselves.
 
Giovanni Montano
Ranch Hand
Posts: 397
6
Android Open BSD Slackware
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:If it was a search engine, please quote the link where you found the solution. That would help in case it occurs again, and we can inspect the link ourselves.

Sure
http://stackoverflow.com/questions/16428098/groovy-shell-warning-could-not-open-create-prefs-root-node
 
Campbell Ritchie
Sheriff
Posts: 55329
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the link
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!