LoginSignup
6
1

More than 5 years have passed since last update.

Eclipseのコンソールでctrl+d (EOF) が認識されない

Posted at

Scanner使ってるときに、ctrl+dで送れるはずのEOFでhasNext()が終わったり終わらなかったりしてもにょもにょする問題の対策

環境

  • Version: Luna Service Release 2 (4.4.2)

  • こういうのを実行して、入力をコピペしてctrl+d -> 入力待ちが終了しない

while (sc.hasNext()) {
    int n = Integer.parseInt(sc.next());
    list.add(n);
}       

解決策

"If you leave the console to focus on another view, and then refocus on the console, then Ctrl-D (EOF) works as expected."

  • 「コンソールからフォーカス外して、もう一回フォーカスしてから入力したらいけるで」
    • いけた
6
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1