0

I'm a complete noob at Java. I'm editing an open source program to serve a different need and when I ran it, I get an error msg: "java.lang.NullPointerException". But I am not told where it happens. How do I find out? I'm Using Eclipse 4.5.1--if you need to know more feel free to ask.

Off to the side of where I type this I see a box that says [my notes are embedded]:

"If you still need help, please include specific details about the code that's causing this exception:

the code itself [the where is what I don't know]
the inputs [none?]
the exception message and stack trace [I don't see and exception message and I don't know how to do a stack trace]

NOTE: I am NOT asking what IS a "NullPointerException". I have seen explanations of it and understand that part.

Now, anyone who has actually used Eclipse knows that when you hit run (and you have errors?), then in the consloe it will tell you:

"- ERROR - java.lang.NullPointerException java.lang.NullPointerException" etc.

What this does NOT do and what I am asking FOR is, how do I find WHERE these errors took place.

So, as you can see my question is NOT a dupe of anyone else's question.

Hoepfully, that has cleared up some confusion. I wasn't aware that I need to go into this kind of detail.

  • How do you know that there is a NPE going on if you don't see a stacktrace? Are you catching exceptions properly? Are you using a debugger to help you? – Hovercraft Full Of Eels Mar 02 '16 at 22:40
  • 1
    Search this site for "how to read a stack trace". – Kevin Krumwiede Mar 02 '16 at 22:41
  • Closing as dupe because an answer addresses this too: http://stackoverflow.com/a/24100776/1864167 – Jeroen Vannevel Mar 02 '16 at 22:42
  • 1
    To summarise, easiest way: just run program in Debug, programming terminates due to exception thrown, click on exception name in Eclipse console, popout asks if you'd like to add exception to breakpoint, click OK, run programming in Debug again, and taaaadah, you get to review the stack trace and figure out what threw the exception. – Tacocat Mar 02 '16 at 22:51
  • Tacocat has given the best explanation so far. When I did that I can see a line where the error is, but not why--in fact, I don't know where that line is! It seems like the engine was supposed to access code on the internet somewhere. "izforge.izpack" etc. – David Conklin Mar 04 '16 at 03:41

0 Answers0