简体   繁体   中英

Debug NullPointerException in Eclipse

I ran a program and received an null pointer exception. I added a Java Exception breakpoint and debug. For example, it broke at line 11 in a method called "myMethod". On line 11, it shows that the object "Box" is null in debuger. From here, how can I step back to trace the root of the cause? I think the problem occurs outside of the method "myMethod", because the object Box is passed as a parameter of the method and is shown as null.

Thank you.

You should see a stacktrace in the tab called "Debug" in the debug view. When you hit the breakpiont in myMethod, go to the stack trace in the debug view and click on the previous method in the stack trace and look at the value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM