title: how to get full path of the current file including the src file in java
body: <p>I have a file dateTesting.java . the path's directory is as follows: D:\workspace\Project1\src\dateTesting.java . I want the full path of this file as "D:\workspace\Project1\src" itself but when I use any of the following code, i get only "D:\workspace\Project1" . the src part is not coming. </p>
  
  <pre><code>System.out.println(System.getProperty("user.dir"));
  File dir2 = new File(".");
  System.out.println(dir2.getCanonicalPath().toString());
  System.out.println(dir2.getAbsolutePath());
  </code></pre>
  
  <p>How can I get the full path as "D:\workspace\Project1\src" ? I'm using eclipse ide 3.5</p>
  
  <p>Thank you</p>