I am current using a small command line interface for one of our tools.
I would like to to provided input from a file or bash script file to automate the input.
Problem is the CLI uses multiple Scanner object to read input from stdin. There is not a problem inherently when manually inserting input since only one Scanner object is used at any given time, but when stdin in redirected, seems the buffer is attached to the first Scanner object which is only used for the first value read and I receive the java.util.NoSuchElementException
.
Just to add, my conclusion on the issue is based on this: Error while redirecting the input from file
Is there any bash magic I can use to redirect stdin in this case? Or maybe even JVM args to assist?