title: How to clear console in Java - Eclipse
body: <p>How to clear the console after a few statements have been executed/printed in Eclipse. I have used flush() but didn't work though. Just posting the sample code.</p>
  
  <pre><code>System.out.println("execute ");
  System.out.println("these set of lines ");
  System.out.println("first");
  
  Thread.sleep(2000); // just to see the printed statements in the console
  System.out.flush(); // it is not clearing the above statements
  </code></pre>