problem exception with netbeans 4.1



Hello,

I have a problem with my program with netBeans 4.1 can you help me?
---------------------------------------------

import java.util.Scanner;

public class Create
{
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
System.out.println("press any key");
String stop = s.nextLine();
}
}

I don t have any problem with the console mode. But with netBeans 4.1 I
have the folowing exception :

press any key

Exception in thread "main" java.util.NoSuchElementException: No line found
at java.util.Scanner.nextLine(Scanner.java:1471)
at Create.main(Create.java:8)

Do you have any idea?

Thanks for help




.



Relevant Pages

  • Re: When is an error not an error?
    ... My IDE (NetBeans) gives no error and runs it fine. ... Here's my SSCCE, because I needed a main method. ... public static void main{ ...
    (comp.lang.java.programmer)
  • Re: Java IDE for Beginners
    ... that i can use that'll help me, i dont care if its complicated, i just ... i tried netbeans which comes bundled with java sdk 6 ... public static void printAll(Object ... ... args){// Error Here ...
    (comp.lang.java)
  • Re: Java IDE for Beginners
    ... IDE is faulty, or somethin is wrong with my sys config. ... I use Netbeans ... public static void printAll(Object ... ... args){// Error Here ...
    (comp.lang.java)
  • Re: JScollPane wont resise with GridBagLout
    ... >>> I'm doing this in netbeans but the produced code leads me to believe this is not ... java.awt.GridBagConstraints gridBagConstraints; ... public static void main{ ... private javax.swing.JScrollPane jScrollPane1; ...
    (comp.lang.java.gui)