A complete listing of the commands available within jShell. - Java Language Basics

Java examples for Language Basics:jShell

Introduction

The following table lists the complete listing of the commands available within jShell.

CommandDescription
/l or /listLists the sources typed into the current session.
/e or /edit [name or id of source] Opens JShell Edit Pad.
/d or /drop [name/id of source]Deletes or drops the source referenced by name or id.
/s or /save [all|history] Saves sources that have been typed in the current session.
/o or /openOpens a file of source within the jShell.
/v or /varsLists variables that have been declared in the current session along with their current values.
/m or /methods Lists the methods that have been declared in the current session.
/c or /classes Lists the classes that have been declared in the current session.
/x or /exitExits the current jShell session.
/r or /reset Resets the JShellState for the current session.
/f or /feedback [level] Initiates feedback- options include (off, concise, normal, verbose, default, or ?).
/p or /promptToggles the display of the prompt within the shell.
/cp or /classpath [path] Adds the typed path to the current CLASSPATH.
/h or /history Lists the history of the active JShellState.
/setstart [file] Reads and sets the startup definition file.
/savestart [file]Saves the current session's definitions to the designated startup file.
/! Re-executes the last code snippet.
/<n> Re-executes the nth code snippet.
/-<n>Re-executes the nth previous code snippet.

Related Tutorials