Puneet Varma (Editor)

Jshell

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

jShell is a Java REPL planned to be introduced in the JDK 9. It is tracked by JEP 222: jshell: The Java Shell (Read-Eval-Print Loop).

One of the reasons jShell was proposed for Java 9 is that a lot of applications use their own mechanisms to interactively evaluate expressions, and the de facto library to use a Java REPL was often BeanShell, which is a dormant project since 2003, and which made arbitrary changes to the Java language.

Example

jshell> int x=5 x ==> 5 | created variable x : int jshell> x x ==> 5 | value of x : int

References

Jshell Wikipedia