当前位置: 技术问答>java相关
请问在java中如何取得当前工作目录?
来源: 互联网 发布时间:2014-12-25
本文导语: | String cur_dir=System.getProperty("user.dir"); | System.out.println("TEMP : " + System.getProperty("java.io.tmpdir")); System.out.println("PATH : " + System.getProperty("java.library.path")); System.out.println("CLASSPATH : " + System.get...
|
String cur_dir=System.getProperty("user.dir");
|
System.out.println("TEMP : " + System.getProperty("java.io.tmpdir"));
System.out.println("PATH : " + System.getProperty("java.library.path"));
System.out.println("CLASSPATH : " + System.getProperty("java.class.path"));
System.out.println("SYSTEM DIR : " + System.getProperty("user.home")); // ex. c:windows on Win9x system
System.out.println("CURRENT DIR: " + System.getProperty("user.dir"));
System.out.println("PATH : " + System.getProperty("java.library.path"));
System.out.println("CLASSPATH : " + System.getProperty("java.class.path"));
System.out.println("SYSTEM DIR : " + System.getProperty("user.home")); // ex. c:windows on Win9x system
System.out.println("CURRENT DIR: " + System.getProperty("user.dir"));