Why doesn't System.in.read() block when I'm using Gradle?

By default the ‘run’ task (and tasks of type ‘JavaExec’ in general) default to using an empty stdin for child processes. If you want the child process to consume from System.in, you can configure the run task like this:

run {

standardInput = System.in

}

5 Likes