Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Killing JShell infinite loop

a7bc618c-d11d-472a-bf3e-69462cfbd1f2Mar 14 2016 — edited Mar 14 2016

When having the following code:

while (true) { }

Hitting CTRL+C will kill the loop and return back to the JShell.

But having a print statement inside the loop:

while (true) { System.out.println(1); }


Can't be killed. The weird thing is that replacing the 1 with a string (say "hello world"), then it *can* be killed.


Any clues?

Comments
Post Details
Added on Mar 14 2016
0 comments
913 views