比如临时文件夹设置在哪里,怎么取?

解决方案 »

  1.   

    import java.util.Iterator;
    import java.util.Map;public class GetSystemInfo {
    /**
     * @param args
     */
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    Map map = System.getenv();
    Iterator iter = map.entrySet().iterator();
    while (iter.hasNext()) {
        Map.Entry entry = (Map.Entry) iter.next();
        System.out.print(entry.getKey()+":"+entry.getValue());
        System.out.println();
    }
    }
    }
    获得系统环境变量
      

  2.   

    编译不过去.Map map = System.getenv();没有getenv这个方法.提示:The method getenv(String) in the type System is not applicable for the arguments ()我用JDK1.4.2
      

  3.   

    谢谢zx2002027(希望之星) 解答.我试试JDK1.5