How to clear the console?
Since there are several answers here showing non-working code for Windows, here is a clarification: This command does not work, for two reasons: There is no executable named cls.exe or cls.com in a standard Windows installation that could be invoked via Runtime.exec, as the well-known command cls is builtin to Windows’ command line interpreter. When launching a new process via Runtime.exec, the standard output gets … Read more