2020
09-24
09-24
Java获取工程路径方法详解
第一种: Filef=newFile(this.getClass().getResource("/").getPath()); System.out.println(f);结果:C:\Documents%20and%20Settings\Administrator\workspace\projectName\bin获取当前类的所在工程路径;如果不加“/”: Filef=newFile(this.getClass().getResource("").getPath()); System.out.println(f);结果:C:\Documents%20and%20Settings\Administrator\workspace\projectName\bin\com\...
继续阅读 >