Java I/O How to - Get the Current Working Directory








Question

We would like to know how to get the Current Working Directory.

Answer

    

public class Main {
  public static void main(String[] argv) throws Exception {

    String curDir = System.getProperty("user.dir");
  }
}