Can Java program know its current directory?
<p>Is it possible for Java application to know the its own current directory. I am referring to result of <code>pwd</code>.</p>

<p>For instance, when executed</p>

<pre><code>~/Documents/workspace/Project/bin $ java com/foo/bar/baz/Runner files/text1.txt 
program should know ~/Documents/workspace/Project/bin


~/Documents/workspace/Project $ java com/foo/bar/baz/Runner files/text1.txt 
program should know ~/Documents/workspace/Project
</code></pre>
