newbie question: how to debug?
hi,
i'm new to intellijidea and j2sdk. i want to debug my source files by adding watches and tracing the code. i click on the debug menu and add some watches. but i cannot step into the code because all those options are disabled! i activated the compiler option: "generate debugging info" but still it's useless. can anyone please tell me how to trace a simple code step by step in detail please?
thanks in advance
请先登录再写评论。
Did you recompile all the files (Build->Rebuild Project) after you
activated the "generate debugging info"?
It seems the files still don't have debugging info.
yes, i tried it but still the buttons are disabled and i cannot step into the code. do you have any more advice for me?
How do you start your applicaton?
"zirtik" <no_mail@jetbrains.com> wrote in message
news:7874168.1093888906945.JavaMail.itn@is.intellij.net...
adding watches and tracing the code. i click on the debug menu and add some
watches. but i cannot step into the code because all those options are
disabled! i activated the compiler option: "generate debugging info" but
still it's useless. can anyone please tell me how to trace a simple code
step by step in detail please?
>
zirtik wrote:
Tried, and? Did the rebuild actually go through?
Try completely removing the output dir (all the class files),
recompiling (confirm that the debug switch is on) and debuggin again
I've no further suggestions. Debugging has always worked for me.
i found the solution! i did not actually specify any breakpoints in the code. what i have been doing was only pressing the "debug" button without specifying any breakpoints so the compiler was just running the whole application. yasterday i specified a breakpoint in the beginning of the code, then pressed the debug button, and bingo! i was able to use the "step into", "step over"..etc buttons. well as an experienced c and c++ programmer, i was able to use those buttons without a breakpoint so i was missing the whole thing in intellijIDEA. anyway, i guess this is the only way to trace the code by running the application line by line. please correct me if i'm wrong, thanks.