This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of React Cookbook: Recipes for Mastering the React Framework and have David Griffiths & Dawn Griffiths on-line!
See this thread for details.
Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Could not create system prefs directory

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 24189
166
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 24189
166
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Let's go to the waterfront with this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic