How to quit the JShell and go back to the command-line?

Solution 1:

You can use the JShell command to exit as:

/exit

Side note: Interestingly, with the use of command abbreviations for input shortcuts:-

/ex

(of course /exi) also, resolves into the same command.

enter image description here

Solution 2:

inorder to exit from jshell you can use the command /exit