开发者

Why doesn't JRuby script.rb > out.txt capture Java errors?

JRuby script.rb throws many Java errors.

I tried outputting to a text file, but only the output from the script itself is recorded. I need to capture all the 开发者_开发知识库errors that happen, as they are very long. How can I do that?


The errors probably go to the error stream (stderr), not the output stream (stdout). So you need to redirect the error stream into the output stream:

script.rb > out.txt 2>&1

Or, if you want just the errors:

script.rb 2> errors.txt
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜