I'm learning Java. Yesterday I've created a project, I was compiling and running and it was showing full stack trace on exceptions. Something like this:
java.util.NoSuchElementException: No line found
at java.util.Scanner.nextLine(Unknown Source)
at myprog1.MyProg1.main(MyProg1.java:22)
Today maybe I have done something and it doesn't show any stack trace anymore. Only one of the two types of output are showing:
java -XX:-OmitStackTraceInFastThrow -jar myprog1.jar
Exception in thread "main" java.util.NoSuchElementException: No line found
and
java -XX:-OmitStackTraceInFastThrow -jar myprog1.jar
Exception in thread "main"
I'm compiling with flag "-g" in NetBeans IDE. The code is very simple:
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
}
and I use Ctrl-C to generate the exception.