System.out.print("\033[H\033[2J");System.out.flush(); code example Example: java clear console Runtime.getRuntime().exec("cls");