• Post Reply Bookmark Topic Watch Topic
  • New Topic

Could not create system prefs directory  RSS feed

 
Gary McGath
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a question from a newbie to Linux administration.
I've installed JDK 1.4 on a Red Hat 7.3 system as root. For doing Java development, I'm logged in as a regular user. A simple application (2 classes) compiles properly. When I run it, though, I get the following message:
[date] java.util.prefs.FileSystemPreferences$3 run
Could not create system preferences directory. System preferences are unusable.
The application then runs anyway. Can someone suggest what I may have done wrong?
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is just a guess!
maybe the vm creates the prefs directory somewhere in the directory structure of the jdk... because you installed the jdk as root, the normal user does not have permission to create a directory in that structure. you might want to chmod g+w -r jdk.xxx and see what happens.
of course, i could be wrong.
 
Tim Holloway
Saloon Keeper
Posts: 18789
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hate that feature!
Java's looking for /etc/.java/.systemPrefs/.system.lock and /etc/.java/.systemPrefs/.systemRootModFile
Notice they made everything hidden just to make it harder, even though it's in a privileged directory.
A normal user can't create these files, of course. The "quick fix" is supposed to be to run a Java app app as root, though that can fail for one of 2 reasons I know of.
1. It only works if the app in question is a GUI app (Swing)
2. It assumes that the system you're working with CAN run GUI apps as root (I have one that can't - it's a remotely-administered one).
Manually creating the above files (use "touch" to create empty files) and their containing directories will shut the #%#%#!!! up. Rights to the files should be 544, rights to their directories should be 755, owner and group are root for all.
 
Tim Holloway
Saloon Keeper
Posts: 18789
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Addendum, now that I've finished foaming at the mouth.
The message is due to the introduction of the Preferences system added by Sun in JDK 1.4. The Preferences system is a Good Thing, though. They just handled it poorly. What makes it even more aggravating is that the message will repeat every few seconds for as long as the app runs, cluttering up the console window and panicking users.
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for sharing your anger with us, tim! i am still using 1.3, so i have not had the pleasure of dealing with it yet. of course, you spoiled all the fun and told me how to fix it... good post.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!