Bryn
Bryn

Reputation: 1201

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

When using the JShell, how do I exit it back to the CMD line?

I have already tried ctrl + x and just writing quit, but to no joy.

Upvotes: 117

Views: 35533

Answers (4)

Arun AJ
Arun AJ

Reputation: 69

You can either use /exit or /ex to exit from jshell.

enter image description here

The command is mentioned in jshell manual. Manual can be accessed by typing /help.

enter image description here

Upvotes: 1

Naman
Naman

Reputation: 31888

You can use the JShell command to exit as:

/exit

You can also type the end-of-file character, which is Ctrl-D on Linux systems.

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

To see a list of JShell commands like this one, use the /help command.

Upvotes: 198

Sumedh
Sumedh

Reputation: 144

Ctlr + D will quit the JShell and go back to the command-line.

Upvotes: 8

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

Upvotes: 3

Related Questions