Index: src/java/org/apache/fop/fonts/FontCache.java
===================================================================
--- src/java/org/apache/fop/fonts/FontCache.java	(revision 742774)
+++ src/java/org/apache/fop/fonts/FontCache.java	(working copy)
@@ -81,16 +81,23 @@
     }
 
     private static File getUserHome() {
-        String s = System.getProperty("user.home");
-        if (s != null) {
-            File userDir = new File(s);
-            if (userDir.exists()) {
-                return userDir;
+        return toDirectory(System.getProperty("user.home"));
+    }
+
+    private static File getTempDirectory() {
+        return toDirectory(System.getProperty("java.io.tmpdir"));
+    }
+
+    private static File toDirectory(String path) {
+        if (path != null) {
+            File dir = new File(path);
+            if (dir.exists()) {
+                return dir;
             }
         }
         return null;
     }
-    
+
     /**
      * Returns the default font cache file.
      * @param forWriting true if the user directory should be created
@@ -101,13 +108,18 @@
         if (userHome != null) {
             File fopUserDir = new File(userHome, FOP_USER_DIR);
             if (forWriting) {
-                fopUserDir.mkdir();
+                boolean writable = fopUserDir.mkdir();
+                if(!writable){
+                    userHome = getTempDirectory();
+                    fopUserDir = new File(userHome, FOP_USER_DIR);
+                    fopUserDir.mkdir();
+                }
             }
             return new File(fopUserDir, DEFAULT_CACHE_FILENAME);
         }
         return new File(FOP_USER_DIR);
     }
-    
+
     /**
      * Reads the default font cache file and returns its contents.
      * @return the font cache deserialized from the file (or null if no cache file exists or if
