Java Font.createFont fails on Linux because of sun.misc.IOUtils.createTempFile("+~JF", ".tmp", null)

564 views Asked by At

I've some code that ultimately calls Font.createFont. It works fine on server (centos something...) but on my Ubuntu box it dies because of this call that is inside Font.createFont

final File tFile = AccessController.doPrivileged(
                new PrivilegedExceptionAction<File>() {
                    public File run() throws IOException {
                        return sun.misc.IOUtils.createTempFile("+~JF", ".tmp", null);
                    }
                }
            );

My /tmp dir is readable/writable by the entire world. No idea why this is happening.

1

There are 1 answers

0
gotch4 On BEST ANSWER

This was simply failing because my tomcat installation didn't have a temp directory. Creating the directory just solved the problem. :)