One of the nice news of Java 9 is the introduction of a REPL (Read-Eval-Print-Loop):
Let’s take a look at how to use it.
If you have the latest version of the JDK installed just run
Running with Docker
If you don’t have Java 9 installed, you can run it using Docker:
docker run -it openjdk:9-jdk /bin/jshell
Optionally, you can create an alias of this command in your
~/.bashrc, to avoid running it each time.
Taking a look at variables you declared:
Listing resources you typed:
Opening a file:
and, very important, to exit:
For the entire list of available commands run:
For more info and live demo take a look at this good video by Miro Cupak @JavaOne conference.