Here you can find the source of getTempDir()
public static String getTempDir()
//package com.java2s; import java.io.File; public class Main { public static String getTempDir() { String defaultTmpDir = System.getProperty("java.io.tmpdir"); if (defaultTmpDir != null && new File(defaultTmpDir).exists()) { return defaultTmpDir; } else {//from w w w. ja v a2 s. com return System.getProperty("user.home"); } } }