在java.io中的类都将相对路径名解释为以用户工作目录开始,可以通过调用System.getProperty('"user.dir")来获取这个信息。 System.getProperty("user.dir");