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.

Bug 111337

Summary: java.io.Console not supported
Product: projects Reporter: nivag <nivag>
Component: AntAssignee: Jesse Glick <jglick>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: mkleint
Priority: P3    
Version: 5.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description nivag 2007-07-30 11:09:19 UTC
In both NetBeans 5.5.1 and 6.0 M10, java.io.Console is not supported.

However, the following program compiles and runs successfully from the command using
javac/java from both JDK 1.7.0b16 and JDK 1.6.0_02b5:

import java.io.Console;

public class AppConsole
{
    public static void main(final String[] args)
    {
        final Console console = System.console();

        final String input = console.readLine("Please your name: ");

        System.out.printf("Hallo [%s]\n", input);
    }
}

I get 
    Exception in thread "main" java.lang.NullPointerException
for the console.readLine(*) line.
Comment 1 Milos Kleint 2007-08-01 11:05:37 UTC
reassigning to ant for evaluation. For some reason it doesn't work even if I run on the command line through ant ("ant run")
Comment 2 Jesse Glick 2007-08-01 16:38:03 UTC

*** This issue has been marked as a duplicate of 68770 ***