title: java system preferences under different users in linux
body: <p>I'm trying to run multiple jvms (including tomcat) under different users on one linux box. I'm not seeing too many issues, but in catalina.out I keep seeing this:</p>
  
  <pre><code>May 30, 2014 1:16:16 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 7626 ms
  May 30, 2014 1:16:37 PM java.util.prefs.FileSystemPreferences$2 run
  WARNING: Could not create system preferences directory. System preferences are unusable.
  May 30, 2014 1:16:55 PM java.util.prefs.FileSystemPreferences checkLockFile0ErrorCode
  WARNING: Could not lock System prefs. Unix error code -158097957.
  May 30, 2014 1:16:55 PM java.util.prefs.FileSystemPreferences syncWorld
  WARNING: Couldn't flush system prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.
  </code></pre>
  
  <p>I did some digging/reading and deduced the following:</p>
  
  <p>An administrator with root access must create the system preferences directory <code>/etc/.java/.systemPrefs with drwxr-xr-x access.</code></p>
  
  <p>Java's looking for <code>/etc/.java/.systemPrefs/.system.lock</code> and <code>/etc/.java/.systemPrefs/.systemRootModFile</code></p>
  
  <p>Manually creating the above files (use "touch" to create empty files) and their containing directories should fix. Rights to the files should be <code>544</code>, rights to their directories should be <code>755</code>, owner and group are root for all.</p>
  
  <p><em>But</em></p>
  
  <p>I am not root, getting someone to run root is expensive and I have multiple users running jvms, does that mean i have to create those files and set up permissions just so that all users have access with those privileges?</p>
  
  <p>Has anyone ever run into this issue and if they have is there a simpler solution i am missing?</p>