title: how to clear console window in java
body: <p>I try to clear the console window and continue execute the rest of my code(like you navigate to another page when browse web pages)</p>
  
  <p>I found <code>Runtime.getRuntime().exec("cls");</code> but it doesn't work,and says can not run program <code>cls</code> </p>
  
  <p>and I also found a suggestion like print thousand empty lines, which is not what i want.
  I would like to have something like </p>
  
  <pre><code> old code goes here....
   showOption(); //this would display three option like 1,2,3
   input=userInput.nextInt();
   if(input==1){
     clearWindow();/clear the previous stuff from the console
     showOptionOneDetail(); //leave only option one detail on the console
   }
  </code></pre>
  
  <p>after the user select a option, like 1, then i want to clear window, and continue display the detail for the specific option, it's that possible?</p>
  
  <p>I'm testing using mac in eclipse</p>