JShell Edit Pad running only one line when accepting

206 Views Asked by At

I'm learning to use jshell, and tried to write a snippet of code in the edit pad. When hitting accept, if all the code is in the window only the first line is processed and saved. If I close and open the edit pad, all other lines vanish.
I can use the edit pad if I input the lines one at a time and hit accept after every one, but then it's no different than just writing in the command prompt.

I'm using JShell 10.0.2.

1

There are 1 best solutions below

0
On

Starting JDK 12, it runs multiple lines when you hit Accept in JShell Edit Pad. Just make sure you start fresh JShell Edit Pad by resetting as below:

/reset

enter image description here