JShell, new Java 9 REPL for Interactive Hacking

Java 9 brings us a revamped and overhauled BeanShell that uses standard Java syntax for the scripting. In this tutorial, we demonstrate how to get started. We look at the start-up speed and explain why it is so much worse than other languages. We also show how our performance overtakes other languages once the classes are optimized and compiled, producing many factors speed improvements.

Even though it is not recommended or fully supported, we show how we can write unix scripts by declaring the path to jshell in the first line, prepended with "#!".

Lastly, we write a simple echo server using (mostly) anonymous variables.

JShell is a welcome addition to Java 9, but most of its users will probably be experienced Java programmers who already have a decent idea of what classes are available in the JDK. For beginners, sticking with a good IDE would be preferable.

Audience: beginner to intermediate Java programmer

JShell adds wings to your Java exploration

Unsubscribe

Cretesoft Limited 77 Strovolos Ave Strovolos, Lefkosia 2018 Cyprus