Tooling beginner

JShell for prototyping

Try Java expressions interactively without creating files.

✕ Java 8
// 1. Create Test.java
// 2. javac Test.java
// 3. java Test
// Just to test one expression!
✓ Java 9+
$ jshell
jshell> "hello".chars().count()
$1 ==> 5
jshell> List.of(1,2,3).reversed()
$2 ==> [3, 2, 1]

Instant feedback

Type an expression, see the result immediately.

📝

No files needed

No .java files, no compilation step.

🔍

API exploration

Tab completion helps discover methods and parameters.

Old Approach
Create File + Compile + Run
Modern Approach
jshell REPL
Since JDK
9
Difficulty
beginner
JShell for prototyping
Available

Widely available since JDK 9 (Sept 2017)

How it works

JShell is a Read-Eval-Print Loop for Java. Test expressions, experiment with APIs, and prototype code without creating files, compiling, or writing a main method. Tab completion and inline docs included.

Share 𝕏 🦋 in