User Input ignored in JShell console
(IntelliJ IDEA 2019.3.3 (Ultimate Edition) Build #IU-193.6494.35)
The JShell console doesn't feel the need to wait for user input as it does when run 'manually' via a main method.
import java.util.Scanner;
Scanner scanner = new Scanner(System.in);
System.out.println(scanner.nextLine());
Gives output in console:
Defined import java.util.Scanner
Defined field Scanner scanner = java.util.Scanner[delimiters=\p{javaWhitespace}+][position=0][match valid=false][need input=false][source closed=false][skipped=false][group separator=\,][decimal separator=\.][positive prefix=][negative prefix=\Q-\E][positive suffix=][negative suffix=][NaN string=\QNaN\E][infinity string=\Q∞\E]
No line found
System.out.println(scanner.nextLine())
Please sign in to leave a comment.
Hello,
Does it work fine in jshell outside IDE? Also please check this thread for. possible solutions: https://stackoverflow.com/questions/48063408/how-to-take-user-input-in-jshell-script
It fails in exactly the same way unless I set --exectution local (help from: https://stackoverflow.com/a/59476159/5353824).
As is (same as Intelij JShell console) :
With setting:
So is there anyway to set this JSHELL config property for/in the Intelij JShell console?
Currently it's not possible. Please vote for the related request on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-179252