java得到当前文件路径

  第一种:  File f = new File(this.getClass().getResource("/").getPath());  System.out.println(f);  结果:  C:\Documents%20and%20Settings\Administrator\workspace\projectName\bin  获取当前类的所在工程路径;  若是不加“/”  File
相关文章
相关标签/搜索