I’m trying to debug a Null Pointer Exception in java, but the stack trace is being unhelpful. It can’t point me to anything in particular:
[exec] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
[exec] at core.InputPanel.<init>(Unknown Source)
[exec] at core.Main.<init>(Unknown Source)
How can I narrow down where this null pointer might be?
You have compiled your source code without debug information; e.g.
javac -g:none .... Compile with debug information (e.g.javac -g ...) and the stack traces will be more informative.Here are some references:
javacmanual page.javactarget in the Ant manual.(FWIW, the default behaviour of the Java compilers … with no
-goptions … is to include source file names and line numbers. So you something in your build scripts is doing something to leave out the debug information. This is good for minimizing the size of your class / JAR files, but it is bad for debugging.)