Aug 03 2009
Java and the current work directory
I spent some time looking this up and hopefully I will save someone else time on this. The current work directory for an application in Java is stored in the system property “user.dir”. This is the default directory that you application will write files to if you don’t specify an absolute file location. You can access it using this Java syntax:
String userDir = System.getProperty("user.dir");
Related posts:
- How to read environment variables in Java You can set environment variables or pass them in using...
- How to automatically provide an answer to Unix commands How do you automatically provide an answer to a Unix...




