min*_*ins 5 java eof console-input
如果这个琐碎的问题已经得到解答,请道歉,我在SO处找不到它.使用此Java简单代码(Windows 7和Eclipse Kepler)从IDE控制台读取行:
int v;
try { while ((v = System.in.read()) != -1) System.out.println(v); }
catch (IOException e) { ; }
Run Code Online (Sandbox Code Playgroud)
用户如何使值v等于-1?(我试过Ctrl+ d- z- x- c- s- e和其他键不重复的行为,但循环随机打断)
Man*_*ani 11
Control+ D应该将EOF字符作为例外发送,但它是Eclipse中的一个错误.
其中一位用户报告为
In Kepler 4.3 eclipse.buildId=4.3.0.M20130911-1000 on Linux the problem
still exists in the Java console. I found the following workaround:
If you leave the console to focus on another view, and then refocus on the console,
then Ctrl-D (EOF) works as expected.
Run Code Online (Sandbox Code Playgroud)
跟着这里
| 归档时间: |
|
| 查看次数: |
11149 次 |
| 最近记录: |