Thursday, June 12, 2014

Problem with Java System Prefs and User Prefs

If you are running on Linux and you find any of the following WARNING messages at your Java Application logs or Web Application logs:

  • FileSystemPreferences syncWorld Couldn't flush user prefs: java.util.prefs
  • Could not create system preferences directory. System preferences are unusable
  • Could not lock system prefs. Unix error code 0
or anything regarding Java System Prefs and User Prefs, the reason is you have installed JDK in your machine but the installer wasn't able to set-up the System Prefs and User Prefs directories properly.

Here's the solution suggested by a guy at this link: https://groups.google.com/forum/#!topic/xnat_discussion/uOd-YyuBhCQ

chmod 755 /etc/.java
chmod 755 /etc/.systemPrefs
touch /etc/.java/.systemPrefs/.system.lock
touch /etc/.java/.systemPrefs/.systemRootModFile
chmod 544 /etc/.java/.systemPrefs/.system*


Everything went well for me after. To be particular, I'm running a web application in Jetty at my IDEA workspace.

I hope this can be useful in the future.