How to clear screen in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to clear screen in java?

I have been trying to add like: -Runtime.getRuntime().exec("cls"); _import java.io.IOException; public class CLS { public static void main(String... arg) throws IOException, InterruptedException { new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor(); } } And more But it still error message So how can I fix it?

23rd Dec 2019, 5:51 PM
Neath
Neath - avatar
1 Answer
0
thank you so much
23rd Dec 2019, 9:08 PM
Neath
Neath - avatar