Getting started with JShell

JShell is a command-line tool that is located in the /bin folder. The syntax for this tool is as follows:

jshell <options> <load files>

As you can see in the following screenshot, there are several options that can be used with this tool:

You have already seen the -h option, which we executed with jshell -h. This provided the listing of JShell options.

To log into your JShell, you can simply use the jshell command. You will see that the prompt in the command window changes accordingly:

Exiting the shell is as ...

Get Mastering Java 11 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.