title: Java is creating file in tomcat bin folder
body: <p>I have written a java program in which I am creating a file. </p>
  
  <pre><code>BufferedWriter writer = 
      new BufferedWriter(
          new OutputStreamWriter(
              new FileOutputStream("myfile.txt"))
  </code></pre>
  
  <p>It is creating the file in the current folder (my project folder). Till here everything is perfect. Now I have designed a servlet and call this class. The file is now getting created in the tomcat bin folder. Do I need to make any changes to <code>classpath</code> or <code>server.xml</code> or <code>context.xml</code> in tomcat?</p>