Storing a file in the user's directory in cross-platform Java

前端 未结 4 1103
遇见更好的自我
遇见更好的自我 2020-12-21 05:52

I have a Java application that runs on Mac and Windows, directly off a CD/DVD with no installation. Now, I need to store a file containing per-user data (think favourites e

4条回答
  •  轮回少年
    2020-12-21 06:12

    As well as user.home, the following is useful for more temporary file storage:

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

提交回复
热议问题