clear java in command prompt code example Example: java clear console Runtime.getRuntime().exec("cls");