title: Clear text printed on the Command Line with Java
body: <p>How I can clear text that prints in command line with Java? I want to clear <code>Text1</code> after prints and overwrite with <code>Text2</code>. I search and find this code but it don't work.</p>
  
  <pre><code>public class className {
  
      public static void main(String[] args) throws IOException {
          System.out.println("Text1");
          Runtime.getRuntime().exec("cls");
          System.out.println("Text2");
      }
  }
  </code></pre>