What is JShell?

JShell is a new tool introduced with Java 9. It is an interactive read-eval-print loop tool that is used to evaluate the following Java programming language components--declarations, statements, and expressions. It has its own API so that it can be used by external applications.

Read-Eval-Print Loop is often referred to as REPL, taking the first letter from each word in the phrase. It is also knows language shell or interactive top-level.

The introduction of JShell was a result of Java Enhancement Program (JEP) 222. Here are the stated goals of this JEP in regards to the Java Shell command-line tool:

  • Facilitate rapid investigation
  • Facilitate rapid coding
  • Provide an edit history

The rapid investigation and coding listed previously ...

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.