Java: Can't execute external exe with arguments

前端 未结 3 645
Happy的楠姐
Happy的楠姐 2021-01-21 17:05

I’m trying to run an external program with arguments. The program can take different types of arguments, for instance avl tip.avl or avl < test.ops<

3条回答
  •  轮回少年
    2021-01-21 18:00

    You cannot redirect input like that from Java. Using < is a special shell pipe redirection command.

    You will either have to use processBuilder.getOutputStream() to write data to the process, or else you can use redirectInput.

提交回复
热议问题