//获取classpath路径
String path2 = Thread.currentThread().getContextClassLoader().getResource("").getPath();
System.out.println("path2 = " + path2);
System.out.println(System.currentTimeMillis());
//一下是获取文件路径路径
System.out.println(System.getProperty("user.dir"));
File directory = new File("");// 设定为当前文件夹
try {
System.out.println(directory.getCanonicalPath());// 获取标准的路径
System.out.println(directory.getAbsolutePath());// 获取绝对路径
} catch (Exception e) {
}