我试过的是:
class TempDir { public static void main (String[] args) { System.out.println(System.getProperty("java.io.tempdir")); } }
我需要保持脚本与Windows和Linux一致,windows返回临时目录,但ubuntu返回null,我不知道为什么?
发布于 2016-02-29 21:25:39
System.out.println(System.getProperty("java.io.tmpdir"));在我的Ubuntu系统上打印/tmp,所以看上去好像你弄错了属性名。
https://stackoverflow.com/questions/35709845
复制相似问题