Cross platform temp file storage in Java

Does Java have any way to create a temporary file "cache" that is cross platform? I need to store a certain file for a couple of seconds somewhere on the disk that is not the desktop and that supports Windows, Mac and Linux.

I've looked at File.createTempFile() but that doesn't work on my Linux machine for some reason.