Why does read-line not return after hitting ENTER (seems like a hang) using lein run, but works with lein repl?

前端 未结 2 1493
你的背包
你的背包 2021-01-05 12:30

The problem at hand is that when I run my program with lein run it gets to the (read-line) part and I can\'t get out of it, meaning: read-line neve

2条回答
  •  难免孤独
    2021-01-05 12:56

    Try lein trampoline run, it works.

    The following is from leiningen FAQ:

    Q: I don't have access to stdin inside my project.

    A: This is a limitation of the JVM's process-handling methods; none of them expose stdin correctly. This means that functions like read-line will not work as expected in most contexts, though the repl task necessarily includes a workaround. You can also use the trampoline task to launch your project's JVM after Leiningen's has exited rather than launching it as a subprocess.

提交回复
热议问题