title: How eclipse executes a Java application?
body: <p>I have a very simple <code>.java</code> file in Eclipse Java Project that creates a <code>.txt</code> file. </p>
  
  <pre><code>package mproject.assgn.q12;
  
  import java.io.BufferedWriter;
  import java.io.File;
  import java.io.FileWriter;
  import java.io.IOException;
  
  public class ColumnPattern {
  
      public static void main(String[] args) {
          System.out.println(getInputFile().getAbsolutePath());
      }
  
      private static File getInputFile() {
  
          String content = "110\t100\t255\t122\n"
                  + "100\t109\t180\t111\n"
                  + "22\t101\t122\t110\n"
                  + "211\t122\t177\t101";
  
          File file = new File("file2.txt");
          try {
  
              if(!file.exists()){
  
              System.out.println("Creating Input File since it does'nt exist");
              file.createNewFile();
  
              }
  
              FileWriter fw = new FileWriter(file.getAbsoluteFile());
              BufferedWriter bw = new BufferedWriter(fw);
  
              bw.write(content);
              bw.flush();
              bw.close();
  
              return file;
          }
  
          catch(IOException e){
              e.printStackTrace();
              System.err.println("Error during File I/O");
          }
  
          return null;
      }
  
  }
  </code></pre>
  
  <p>What I want to know is why the file that is created is found under <code>/projectFolder/</code>, while the .java resides in <code>/projectName/src</code> and the class file resides in <code>/projectFolder/bin</code>. <strong>Shouldn't the text file be created under the /bin folder where the .class file resides ?</strong></p>
  
  <p>How does eclipse execute the .java file when we select "<code>Run As Java Application</code>" ?</p>
  
  <p>Does it compile it to a jar and then execute it ? </p>