Take the 2-minute tour ×

Just like this command

java XXX a.txt < b.txt

XXX is a class file. It can run normally if I use java command line. But when use the eclipse and input a.txt < b.txt at the arguments of eclipse.The program was block. This symbol < is just a string in eclipse,but it has some special function in java command line. So how to make the result of eclipse normally? Thank You!

share|improve this question

closed as not a real question by Phil Rykoff, Jonathan Leffler, James Wood, Bhavik Ambani, Neolisk Dec 24 '12 at 2:42


1 Answer 1

On the command line, < b.txt is not part of the command-line arguments.

java XXX a.txt < b.txt

tells the shell to run java XXX a.txt, with the contents of b.txt provided as standard input.

Eclipse apparently does not support this. But if you're willing to change your Java program, you could have it take a second filename as a command-line argument, and read from that (if it is provided) rather than standard input.

share|improve this answer
Thank you very much! sorry,my English is bad. Thanks for you can understand what I say.I have implemented a method by using System.setIn(). –  Sunny Dec 23 '12 at 4:23
