not able to change java.io.tmpdir

本小妞迷上赌 提交于 2019-12-05 06:27:49

You need to use that command as part of running a program, not just java -Dkey=value.

java -Djava.io.tmpdir=/temporary com.foo.Bar

where com.foo.Bar is the class which contains the main method.

Alternatively, you can do this programmatically.

System.setProperty("java.io.tmpdir", "/temporary");
Jon7

Take a look at this answer https://stackoverflow.com/a/1924159/594793

Specifically, this part:

A different value may be given to this system property when the Java virtual machine is invoked, but programmatic changes to this property are not guaranteed to have any effect upon the the temporary directory used by this method.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!