JShell คือ REPL tool ของ Java 9 ใช้รันโค้ด snippet แบบ interactive
ใช้คำสั่ง /open [file-path] โหลดโค้ดจากไฟล์ที่บันทึกไว้ (นามสกุล .jsh)
ตัวอย่าง
C:\Users\User>jshell
jshell> /open C:\Users\User\Desktop\save.jsh
jshell> /list
1 : int x = 15;
2 : double y = 25.0;
3 : public int sum(int a, int b) { return a + b; }
jshell> x
x ==> 15
jshell> y
y ==> 25.0
jshell> int result = sum(5, 7)
result ==> 12
คำสั่ง /open จะโหลดโค้ดและคำสั่งภายในทั้งหมดจากไฟล์ .jsh