Eclipse从文件中读取stdin(System.in) [英] Eclipse reading stdin (System.in) from a file
本文介绍了Eclipse从文件中读取stdin(System.in)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Eclipse可以从文件读取stdin吗?
解决方案
纯Java
您可以使用一行代码重定向System.in:
System.setIn(new FileInputStream (文件名));
请参阅
Is it possible for Eclipse to read stdin from a file?
解决方案
Pure Java
You can redirect System.in with a single line of code:
System.setIn(new FileInputStream(filename));
See System.setIn().
Eclipse config
In Eclipse 4.5 or later, the launch configuration dialog can set System.in to read from a file. See the announcement here.
这篇关于Eclipse从文件中读取stdin(System.in)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文