This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[ BUILD # : 201102111519 ] [ JDK VERSION : 1.6.23 ] I've created Java Application project with the default settings. In the main method I have the code: Console con = System.console(); if (con != null) { String s = con.readLine(); System.out.println(s); } Scanner s = new Scanner(System.in); System.out.println(s.nextLine()); If I run this program from IDE it only prompts once to enter something. But if I run it from cmd window, it prompts twice. I guess System.console() should not return null in NetBeans IDE
System.console() is only available from a true terminal, which Ant-based program execution is not. For now such programs can be run outside NetBeans, or using Window > Output > Terminal. *** This bug has been marked as a duplicate of bug 68770 ***