Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wiki Markup
{div:class=navigation}
{table:width=100%}
{tr}
{td:width=33%}{align:left}[Previous|Version Control Basics] {span:class=sep}\| {span}{span:class=text}Version Control Basics{span}{align}{td}
{td:width=33%}{align:center}[Top|Quick Start] {span:class=sep}\| {span}{span:class=text}Quick Start{span}{align} {td}
{td:width=33%}{align:right}[Next|Keymap] {span:class=sep}\| {span}{span:class=text}Keymap{span}{align} {td}
{tr}
{table}
{div}
Wiki Markup
{redirect:https://www.jetbrains.com/idea/help/debugger-basicsdebugging-your-first-java-application.html|delay=0}

1. Run debug

...

2. Useful debugger shortcuts

  • Toggle breakpoint via

    Wiki Markup
    {span:class=shortcut}Ctrl{span}
    +
    Wiki Markup
    {span:class=shortcut}F8{span}
    (
    Wiki Markup
    {span:class=shortcut}Cmd{span}
    +
    Wiki Markup
    {span:class=shortcut}F8{span}
    for Mac)

  • Resume program via

    Wiki Markup
    {span:class=shortcut}F9{span}

  • Step over via

    Wiki Markup
    {span:class=shortcut}F8{span}

  • Step into via

    Wiki Markup
    {span:class=shortcut}F7{span}

  • Stop via

    Wiki Markup
    {span:class=shortcut}Ctrl{span}
    +
    Wiki Markup
    {span:class=shortcut}F2{span}
    (
    Wiki Markup
    {span:class=shortcut}Cmd{span}
    +
    Wiki Markup
    {span:class=shortcut}F2{span}
    )

  • View breakpoint details/all breakpoints via

    Wiki Markup
    {span:class=shortcut}Shift{span}
    +
    Wiki Markup
    {span:class=shortcut}Ctrl{span}
    +
    Wiki Markup
    {span:class=shortcut}F8{span}
    (
    Wiki Markup
    {span:class=shortcut}Shift{span}
    +
    Wiki Markup
    {span:class=shortcut}Ctrl{span}
    +
    Wiki Markup
    {span:class=shortcut}F8{span}
    )

  • Debug code at caret via

    Wiki Markup
    {span:class=shortcut}Shift{span}
    +
    Wiki Markup
    {span:class=shortcut}Ctrl{span}
    +
    Wiki Markup
    {span:class=shortcut}F9{span}
    (e.g if you stay within the main method)

3. Smart step into

Sometimes it happens that you stay at a line and want to step into a particular method but not the first one which will be invoked. In this case you can use Smart step into by pressing

Wiki Markup
{span:class=shortcut}Shift{span}
+
Wiki Markup
{span:class=shortcut}F7{span}
(
Wiki Markup
{span:class=shortcut}Cmd{span}
+
Wiki Markup
{span:class=shortcut}F7{span}
for Mac) to choose a particular method. This is a great time-saver.

...

Sometimes you need to resume the program and stop at another line of code, without adding another break point. Easy: just press

Wiki Markup
{span:class=shortcut}Alt{span}
+
Wiki Markup
{span:class=shortcut}F9{span}
.

...

If you want to change the default debugger settings, press

Wiki Markup
{span:class=shortcut}Settings{span}
Wiki Markup
{span:class=shortcut}Debugger{span}
.

Wiki Markup
{div:class=navigation}
{table:width=100%}
{tr}
{td:width=33%}{align:left}[Previous|Version Control Basics] {span:class=sep}\| {span}{span:class=text}Version Control Basics{span}{align}{td}
{td:width=33%}{align:center}[Top|Quick Start] {span:class=sep}\| {span}{span:class=text}Quick Start{span}{align} {td}
{td:width=33%}{align:right}[Next|Keymap] {span:class=sep}\| {span}{span:class=text}Keymap{span}{align} {td}
{tr}
{table}
{div}