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