title: How to get the execution directory path in java
body: <p>I have made a pure java app which tells me about number of files in a given directory. Now I set current directory by using the following code:</p>
  
  <pre><code>`File f = new File(".");`
  </code></pre>
  
  <p>After that I made an installer with its jar file and installed it in my windows 8 and then I add it to the windows right click drop down menu (context menu). When I launch it from the context menu it always tells me about the number of files in the directory where it is actually installed in however I want to know the number of files of that directory from where I am executing it.</p>
  
  <p>So plz help me. I am a novice in this field and I don't want you to confuse me in current directory and the current execution directory. So I write this so long and hoping for a clean answer in very simple words.</p>
  
  <p>Thanks</p>