user2597012
user2597012

Reputation: 647

Why doesn't Eclipse recognize Input Redirection

I was wondering why doesn't Eclipse recognize the command (command2="java -cp "+ args[0] + " " + args[1] + < input.txt";)

when I run the command from eclipse, but it works when i run it directly from CMD. How can this issue be fixed?

Thanks

Upvotes: 0

Views: 120

Answers (1)

nanofarad
nanofarad

Reputation: 41281

There's a missing quote:

command2="cmd -C \"java -cp "+ args[0] + " " + args[1] + "< input.txt\"";

Even with redirection, < is still an explicit character (not an operand) in a string representation of the command.

Upvotes: 0

Related Questions