Windows temp directory details (Java)

后端 未结 7 2239
一生所求
一生所求 2020-12-20 15:12

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 -

7条回答
  •  遥遥无期
    2020-12-20 15:25

    It sounds like you have two programs that need to share temp files and one definitely doesn't want spaces in the path name. Probably the easiest thing to do is:

    1. set the TMP and TEMP variable to a common directory
    2. launch each application (from this modified environment) - which should pick up the temp variable

    So at the command prompt you could do this:

    1. set TMP=c:\mytemp
    2. set TEMP=c:\mytemp
    3. java -cp x;y;z my.application.Entry
    4. run other application (hopefully it also reads the environment for temp/tmp)

    Hope that helps.

提交回复
热议问题