Java examples for Language Basics:jShell
The following table lists the complete listing of the commands available within jShell.
Command | Description |
---|---|
/l or /list | Lists 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 /open | Opens a file of source within the jShell. |
/v or /vars | Lists 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 /exit | Exits 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 /prompt | Toggles 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. |