Friday, May 20, 2011

Getting Current Directory In Java

To get the current directory address, these two methods are useful:
  • new File(".").getAbsolutePath();
  • System.getProperty("user.dir");
 Thanks to Java-Forums.