The working directory is the location in the file system from where the java command was invoked. It can be obtained by getting user.dir system property using java.lang.System class.

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