What command in Java will let you clear the console in a command-line application?
If none of the above solutions works for you( as in my case ), try this solution:
new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
I'm using Windows 8 and this solution worked for me. Hope it does to you as well. :)
clearing for bash that is working for me:
System.out.print(String.format("\033[H\033[2J"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With