Tag Archives: root directory

Java – Getting current working directory

You can get the current working directory – means the project root folder path by using below code. String  currWorkingDir = System.getProperty(“user.dir”); System.out.println(“Your current working directory is : ” + currWorkingDir ); Example:- public static void main(String[] args) { String currWorkingDir = System.getProperty(“user.dir”); System.out.println(“Current working directory : ” + currWorkingDir ); }