Find current directory java

Find current directory java

If you want to find current working directory using simple java program please see below sample program:

  • Sample java class:
package com.javahonk;

public class FindCurrentDirectory {

	public static void main(String[] args) {
		
		System.out.println("Current Working Directory = "
				+ System.getProperty("user.dir"));

	}

}
  • Output:

Find current directory java

For more information about find current working directory please refer oracle documentation here 

Leave a Reply

Your email address will not be published. Required fields are marked *