Is it possible for Eclipse to read stdin from a file?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
2015 update
There is a new Eclipse version, Eclipse 4.5 (Mars) which has fixed the issue!
This is the announcement and description of the feature: http://eclipse.org/mars/noteworthy/#_assigning_stdin_to_a_file
As expected, this is a new feature of the just released eclipse 4.5 and will therefore not work in an older version.
This is surprisingly not supported in Eclipse and it seems there are no current plans to add it. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=155411 to follow and vote.
I will update here if it they do implement it.
On the "common" tab of the run dialog, under "Standard Input and Output" there's a checkbox for "file". but it appears to be only for output...
I'd expect to see 2 file fields there, one for standard in, one for standard out with the append options.
The solution for me (running on a Mac, using Eclipse CDT for a C application) was to add "< path/to/somefile" at the end of other arguments in the "Arguments" tab of the "Run Configuration" dialog.
Also check this other question for an answer involving launching a Java program in a suspended state and then attaching the debugger using Eclipse.
I don't see a nice way to do it using the standard Eclipse Run dialog. However, you might be able to do it with an External tool launcher and either use the standard "< infile" syntax or call a .bat/.sh script to do it for you.
It's not automated, which is what I'm guessing you want, but you can copy & paste the contents of your infile to the Eclipse console when you launch your program.