title: Clear screen with Windows "cls" command in Java console application
body: <p>I am working on a game that involves clearing the screen after each turn for readability. The only problem is I cannot use the Windows command prompt-based "cls" command and it does not support ANSI escape characters. I used Dyndrilliac's solution on the following page but it resulted in an IOException:</p>
  
  <p><a href="https://stackoverflow.com/questions/2979383/java-clear-the-console">Java: Clear the console</a></p>
  
  <p>Replacing "cls" with "cmd \C cls" only opened a new command prompt, cleared it, and closed it without accessing the current console. How do I make a Java program running through Windows Command Prompt access the command prompt's arguments and use them to clear its output?</p>