第一种: File f = new File(this.getClass().getResource("/").getPath()); System.out.println(f); 结果: C:\Documents%20and%20Settings\Administrator\workspace\projectName\bin 获取当前类的所在工程路径; 如果不加“/” File f = new File(this.getClass().getResource(""…
第一种: File f = new File(this.getClass().getResource("/").getPath()); System.out.println(f); 结果: C:\Documents%20and%20Settings\Administrator\workspace\projectName\bin 获取当前类的所在工程路径; 如果不加"/" File f = new File(this.getClass().getResource(&q…
第一种: File f = new File(this.getClass().getResource("/").getPath()); System.out.println(f); 结果: C:\Documents%20and%20Settings\Administrator\workspace\projectName\bin 获取当前类的所在工程路径; 如果不加“/” File f = new File(this.getClass().getResource(""…
import java.io.File; public class Test { public static int count = 0; public static void main(String[] args){ String path = "G:/Document/HongDaXingYe/Project/oa/workflow/home/weaver/ecology/workflow/"; // String path = "G:/Document/HongDaXi…
public class Test { public void run() { // TODO Auto-generated method stub System.out.println("测试========>"); String s1=this.getClass().getResource("").getPath(); String s2=this.getClass().getResource("/").getPath(); Syste…