dcoder
09-15-2005, 04:31 PM
I'm going mad everyone.
All I want to do is clear the console's buffer (i.e. "cls in Windows, "clear" in Unix).
I've googled this quite a bit and found nothing useful.
Sun's forums are completely useless, there are about 20 threads asking the same question and the only replies are to put in a loop with a bunch of System.out.println(). There is another "solution" but it's a nasty hack that involes editing system files (and thus makes it difficult to distribute my application!).
I'm just not convinced that there's "no way to do it."
Does ANYONE know how to clear the console??!
Thanks,
Kyle
Edit: Also, I've tried using Runtime.exec() to execute the "cls" command, but that seems to start a new console session.
All I want to do is clear the console's buffer (i.e. "cls in Windows, "clear" in Unix).
I've googled this quite a bit and found nothing useful.
Sun's forums are completely useless, there are about 20 threads asking the same question and the only replies are to put in a loop with a bunch of System.out.println(). There is another "solution" but it's a nasty hack that involes editing system files (and thus makes it difficult to distribute my application!).
I'm just not convinced that there's "no way to do it."
Does ANYONE know how to clear the console??!
Thanks,
Kyle
Edit: Also, I've tried using Runtime.exec() to execute the "cls" command, but that seems to start a new console session.