I have a *.jar file. Its *.java reads from console a undefined number of lines. It uses SimpleCharStream entryF = new SimpleCharStream(System.in); for reading from the console.
My question is, without modifying the original class, is there anyway of making this *.jar read from a file?
I am using ubuntu and I have tried using redirections like:
java -jar test.jar < entry.txt but it says “Invalid or corrupt jarfile test.jar”
Thanks.
The error message indicates you aren’t building the jar file correctly.