File file = new File(".");
System.out.println(file.getAbsolutePath);
分别用Java Application运行和tomcat 访问得到的结果分别是(假设项目名字为filter)
E:\Myeclipseworkspace\filter\.
F:\apache-tomcat-7.0.88\bin\.
由此可以看出tomcat服务器是在bin目
录下启动jvm的.其实是在bin目录下的” catalina.bat”文件中启动jvm的.
Eclipse中启动jvm都是在项目根路径上启动的.比如有个项目名为blog,其完整路径为:D:\work\IDE\workspace\blog.那么这个路径就是jvm的启
动路径了