Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MiniMusicCmdLine Chapter 11 Head First Java  RSS feed

 
Bart Boersma
Ranch Hand
Posts: 52
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I am stuck with one of the examples in the book Head First Java. This code is from the book and should work. The error message that is showing me (after I input 102 and 30 (102 30) in the command line in Eclipse):

dec 05, 2016 10:45:33 AM 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.

What is wrong with the code?

Thanks in advance.

My code:
 
Bart Boersma
Ranch Hand
Posts: 52
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed it by opening Eclipse as an administrator.

Can someone explain why running Eclipse as an administrator solves this error?
 
Campbell Ritchie
Sheriff
Posts: 54600
151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know. Maybe you are running Eclipse from a location where you have to be admin. I think you shou‍ld have it in a location in your User folder/its subfolders (or at least have the workspace there).
Lat's try in our IDEs forum.
 
Knute Snortum
Sheriff
Posts: 3735
90
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess would be that Java is doing something (adding or creating a registry node) that needs Admin privileges.  By running Eclipse as Admin, Java gets executed as Admin and the problem goes away.
 
Knute Snortum
Sheriff
Posts: 3735
90
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could test this by manually running the Java program at a command prompt.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!