I think what the OP wants is to clear the screen and move the cursor to the home position. For that try:
final String ANSI_CLS = "u001b[2J";
final String ANSI_HOME = "u001b[H";
System.out.print(ANSI_CLS + ANSI_HOME);
System.out.flush();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…