patkua@work

java.io.tmpdir on Mac JDK1.6

Diagnosing a test failure on a new machine today, I stumbled across this different behaviour in JDK1.6 on my Mac, running OSX10.6.6 where:

System.getProperty("java.io.tmpdir")

was returning a strange value of /var/folders/Ob/Ob-aqIAEG2WzgTa5ezd5qU+++TM/-Tmp-/ (note the plus characters) instead of the normal value of /tmp it used to return. Fortunately this property can also be set at on JVM start, by passing it in as an environment variable

-Djava.io.tmpdir=/tmp
Exit mobile version