

Nonstandard options are subject to change without notice.

Prints a summary of nonstandard options and exits the tool. Prints a summary of standard options and exits the tool. Custom feedback modes are created within JShell by using the /set mode command. Provides custom feedback based on how the mode is defined. The next prompt immediately follows the code snippet. The next prompt immediately follows the code snippet or feedback. The next prompt is separated from the feedback by a blank line. Additional information about the action performed is displayed after the result of the action. The following values are valid for mode: verbose The initial level can be overridden within a session by using the /set feedback mode command. Sets the initial level of feedback provided in response to what’s entered. For Windows, use a semicolon ( ) to separate items. For Linux and macOS, use a colon (:) to separate items in the list. If the environment variable isn’t set and this option isn’t used, then the current directory is searched. This option overrides the path in the CLASSPATH environment variable.

Specifies the directories and archives that are searched to locate class files. To pass more than one flag, provide an instance of this option for each flag or flag argument needed.

Specifies the root modules to resolve in addition to the initial module. To keep snippets for later use, save them to a file. Snippets can be modified within the session to try out different variations and make corrections. Within JShell, commands are available for modifying the environment as needed.Įxisting snippets can be loaded from a file to initialize a JShell session, or at any time within a session. Start with the verbose mode to get the most feedback while learning the tool.Ĭommand-line options are available for configuring the initial environment when JShell is started. Errors are described regardless of the feedback mode. Feedback varies from the results and explanations of actions to nothing, depending on the snippet entered and the feedback mode chosen. The bits of code entered are called snippets.Īs snippets are entered, they’re evaluated, and feedback is provided. Java statements, variable definitions, method definitions, class definitions, import statements, and expressions are accepted. JShell provides a way to interactively evaluate declarations, statements, and expressions of the Java programming language, making it easier to learn the language, explore unfamiliar code and APIs, and prototype complex code.
