Searching...
Tuesday, 24 September 2013

How to get Current working Directory in java ?

11:23

To get current directory location we can use user.dir property

System.getProperty("user.dir")

Example

package com.pretech;
public class CurrentDirectory {
	public static void main(String[] args) {
		System.out.println("Current Directory :"
				+ System.getProperty("user.dir"));
	}
}

0 comments: