Java – How to properly debug Java (Android) using Eclipse?

How to properly debug Java (Android) using Eclipse?… here is a solution to the problem.

How to properly debug Java (Android) using Eclipse?

I’m having trouble debugging my code. One of my AsyncTasks throws a RuntimeException, but I don’t know which line of code is responsible for this. Since I’m new to Eclipse and Java, all of this confuses me.

Eclipse’s debug window shows that my AsyncTask is suspended due to RuntimeException. Below that, there are three lines that indicate certain lines of code. However, these lines are not present in my code, which is why I don’t know what caused my application to crash. Am I missing important information about debugging in Java/Android?

By the way, here are the three lines I get:

ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1086  
ThreadPoolExecutor$Worker.run() line: 561   
Thread.run() line: 1096 

What should I do with it? Would be appreciated.

Best Solution

In DDMS, if you can’t find logcat in DDMS, you can get messages related to errors, warnings, or other types of messages into the logcat window, then go to the menu Window->Show View->logcat Click on it, you can now see the messages in the same DDMS, you can also get the device window from it, select the device so that you can debug or get messages from that device to logcat.

Now check it this way, you can find your error details in this logcat detail

Related Problems and Solutions