Loading scripts

Loading scripts in the JShell can be accomplished with one of the following methods:

  • You can use the /open command along with the name of the script as a parameter. For example, if our script name is MyScript, we would use /open MyScript.
  • A second option for loading scripts is to use the jshell MyScript.jsh at the Command Prompt. This will launch JShell and load the MyScript.jsh JShell script.

Get Java 9: Building Robust Modular Applications 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.