Calling lein repl
actually launches a new background server process for evaluating code; what you see in the console is a client process that sends code to the server for evaluation and then displays the results that are returned. What I suspect is happening here is that, when the REPL server evaluates System/in
, it's actually referring to stdin of the server process, which you can't write to from the client.
Replacing (InputStreamReader. System/in)
with *in*
should allow your code to work from the REPL as well as when launched directly with lein run
or java
.