I\'m writing a program that needs a generic temp folder. I\'m trying to find details about the Windows Temp folders. There are two paths that I know about -
you can try this way
System.out.println(File.createTempFile("temp-file", "tmp").getParent()); String property = "java.io.tmpdir"; String tempDir = System.getProperty(property); System.out.println("OS current temporary directory is " + tempDir);