IntelliJ IDEA: Breakpoint not being hit, and is shown without the tick, just a red dot

JavaDebuggingIntellij Idea

Java Problem Overview


I have a gradle project, and when I put a breakpoint it is displayed as a red dot, with a tick inside, and it just works fine.

working breakpoint

The problem is that in some classes (in the same project, not a dependency class), the red dot doesn't have a tick inside, and it doesn't tell why it wouldn't work. And it just doesn't work..:

enter image description here

What have I tried so far:

  • Gradle clean & build
  • Rebuild project
  • Restart debug
  • Invalidate caches and restart IntelliJ
  • Update IntelliJ to the latest version (2017.2.5)
  • Mute & Unmute breakpoints

This question is similar, but clearly not the same: https://stackoverflow.com/questions/24612603/intellij-idea-breakpoint-not-being-hit-and-is-shown-greyed-out

Java Solutions


Solution 1 - Java

Did some searching through IntelliJ Help PDF:
Help Doc pg. 431

Their documentation Describes the checkmark as "Shown at run-time when the breakpoint is recognized by the debugger as set on an executable code line."

and the regular red dot as "Shown at design-time or during the debugging session when the class with such breakpoint is not yet loaded. "

So it would seem that the line you're adding the breaking point to never gets executed. You can try stepping up line by line through the class to make sure the class is not getting hung up somewhere.

Hope this helps

Solution 2 - Java

I get this same issue intermittently from time to time, I always run the latest version of IDEA. The break points are shown as red but without a tick inside them. Even after I rebuild or re-run in debug they do not get a tick, and they do not "work", i.e., the code continues. I resolve by restarting IDEA, then restarting the debugger/debug run config.

Solution 3 - Java

The same happened with me on Mac machine. I followed these steps and all worked fine:

  1. Stop server.
  2. Close all intellij projects.
  3. Open only the specific intellij project on which my application needs to run.
  4. Start the server in debug mode.

Solution 4 - Java

I made a n00b mistake on the IDE. Instead of hitting the debug button, I thought it would work the same as visual studio or eclipse in that I'd have to use the run button, yet when I hit the debug button (That looks like an actual bug) my break-point hit just fine.

Solution 5 - Java

I fixed this by manually deleting all build-related files (for some reason Rebuild did nothing) by running this command at the project's root folder. Note that it does also remove Intellij's temporary configuration files, that are usually not included in git repositories anyway. Replace MODULE with the subfolder containing the module for the project. If you are building an Android app with Android Studio the main module name is usually app.

rm -rf ./local.properties ./.gradle/ ./.idea/ ./MODULE/build/ ./MODULE/out/

Then restart Intellij with the File -> Invalidate Caches / Restart option, wait for the build and indexing to finish, and debugging should start working again.

Solution 6 - Java

I had the same issue in my mac, tried restarting server, machine, invalidate caches and nothing helped. Then, I noticed when the server is started in debug mode, i didnt see this message: Connected to the target VM, address: '127.0.0.1:64197', transport: 'socket' and I realized that there could be some problem with the server as such.

Solution: Created new server using command line "./server create " and then associated this server for run configuration. Now started server in debug mode and I saw above message connected to socket port and I am able to see the tick marks on debug point.

Solution 7 - Java

I was also facing this issue and found that my tomcat configuration was not right.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
    <scope>compile</scope>
</dependency>

The scope tag had value as "provided". Changed it to compile and it worked fine.

Solution 8 - Java

Android app configuration was the problem for me. I had minifyEnabled true in debug section inside buildTypes in build.gradle file. I had to change it to minifyEnabled false. This change forced me to set multiDexEnabled true as it states in this post https://stackoverflow.com/questions/51341627/android-gives-error-cannot-fit-requested-classes-in-a-single-dex-file/51341735

Solution 9 - Java

Rebuild solved my problem.

clean & rebuild

Invalidates caches/restart if necessary

Solution 10 - Java

My issue got resolved by just updating the IntelliJ in IntelliJIdea -> Check for updates..

Solution 11 - Java

All,

This could be a common bug in the Intellij IDEA debugger instead use the key short cuts like F8 and F9 etc during the debug steps for [ step over and run to debug next point etc..] and don't rely on the debug console buttons provided in the ide

Solution 12 - Java

For some reason we experienced this when we upgraded from java 11 to 17. The fix was to use a SpringBoot configuration and not a maven configuration for run/debug.

Solution 13 - Java

For me it was a port problem, I don't know why but I had to go back to port 8082 which I was using for tomcat.

Solution 14 - Java

This worked for me:

  • Make a note of the Java version in the run configuration tab (for me its JDK 9 or later)
  • Go to File -> Settings -> Search for Java compiler -> set Project Bycode version to the same version that you see in run config.
  • Stop and rerun debugging.

Run config image

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPablo Matias GomezView Question on Stackoverflow
Solution 1 - JavaKedar BrooksView Answer on Stackoverflow
Solution 2 - JavaMattGView Answer on Stackoverflow
Solution 3 - JavaKayVView Answer on Stackoverflow
Solution 4 - JavaSizonsView Answer on Stackoverflow
Solution 5 - JavaStypoxView Answer on Stackoverflow
Solution 6 - JavakumarView Answer on Stackoverflow
Solution 7 - JavaAbhay ManiyarView Answer on Stackoverflow
Solution 8 - JavaBeroView Answer on Stackoverflow
Solution 9 - Javauser2301281View Answer on Stackoverflow
Solution 10 - JavaManu YadavView Answer on Stackoverflow
Solution 11 - Javauser1419261View Answer on Stackoverflow
Solution 12 - JavaM ONeillView Answer on Stackoverflow
Solution 13 - JavahamzaView Answer on Stackoverflow
Solution 14 - Javauser11 7532View Answer on Stackoverflow