How can I get the current working directory with Java?

Tim Rohaly

The current working directory is stored in the system property "user.dir". The following example shows how to read this system property from your application:

public class userdir {
    public static void main(String[] args) {
        System.out.println("Working Directory = " +
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.