System.in.read() always returns -1 from gradle task

I'm trying to create a gradle "run" task that runs an external program (that loads and runs my code). And I need to redirect input and output. I already saw that ProcessBuilder.inheritIO doesn't work here, so I tried to manyallu redirect each stream. It works for System.our/err, but I can't get it working for SYstem.in because read() always returns -1. And I need to be able to interact with it to properly stop it (to redirect input/output I followed this: http://www.javaworld.com/article/2071275/core-java/when-runtime-exec---won-t.html?page=3, and tried the same for System.in)

1

Please sign in to leave a comment.