I didn't find any command to clear Java-9 JShell console. I also tried to clear the JShell Console through this program, but it doesn't work either.
import java.io.IOException;
class CLS {
public static void main(String... arg) throws IOException, InterruptedException {
new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
}
}
I think we don't have that functionality available yet in the early access. Anyone got an idea?
public static void clrscr(){ //Clears Screen in java.
cls() like clrscr() ,system(“clear”) we use system. cls() function to clear console screen .
The Java Shell tool (JShell) is an interactive tool for learning the Java programming language and prototyping Java code. JShell is a Read-Evaluate-Print Loop (REPL), which evaluates declarations, statements, and expressions as they are entered and immediately shows the results. The tool is run from the command line.
Use the Control Key+L or l (lower case L) to clear the JShell console.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With