Pablo Matias Gomez
Pablo Matias Gomez

Reputation: 6813

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

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:

This question is similar, but clearly not the same: Intellij IDEA: Breakpoint not being hit, and is shown greyed out

Upvotes: 89

Views: 124302

Answers (23)

Anthony
Anthony

Reputation: 1

Had the same issue with a Java project in IntelliJ(2023.3.6) and resolved it by Invalidate caches and restart IntelliJ.

Upvotes: 0

AmanicA
AmanicA

Reputation: 5485

For me I just needed to make sure all my cucumber plugins were up to date.

(I think one updated without the other causing a conflict)

Upvotes: 0

Akram Rabie
Akram Rabie

Reputation: 545

I don't know if I should laugh or cry! I've spent so much time to figure it out that what's going on, tried all the suggested solutions non of them worked for me! Turned out I needed click on the debugger link in the debug logs in console and open it!

So basically what I did:

1- Open the debug logs, click on the link:

Debugger listening on ws://127.0.0.1:57292/...

(Screenshot)

2- It will open a new debugging tab

3- Re-add the breakpoints, then you'll see the white checkmarks!

4- Done, that's it!

Upvotes: 0

Boommeister
Boommeister

Reputation: 2107

I stopped the JavaScript Debug, restartet it, but that didn't change something. I then changed to a different browser in my run configurations and suddenly the debugger worked again. But the one breakpoint that I actually wanted to hit still didn't get hit. I had to remove and set the breakpoint again, then it worked (tried that before changing the debug browser, that didn't work, only after changing the debug browser and resetting the breakoint, it worked.) I changed from Edge to Chrome, and when it happens in Chrome, I change back from Chrome to Edge (it happens 1-2 times per month... :(

enter image description here

Upvotes: 0

philburns
philburns

Reputation: 330

For Grails projects:

Instead of using a "Grails Run/Debug Configuration" in IntelliJ, right-click grails-app/init/Application.groovy (or whatever subpath the file may have) and choose the debug option from there.

In my case, now only this brought back the ticks to my debug points.

A Micronaut Run Configuration was created in my project and I was able to save it via the arrow next the new appearing "Application" entry in the Run Configurations dropdown.

Upvotes: 0

Olasoj
Olasoj

Reputation: 1

I had the same problem, however, it was limited to one of the projects. Then I compared the two Run/Debug configurations and discovered a parameter called "before run" that was causing the debug indicator to disappear. The problem was resolved by removing that setting.

Upvotes: 0

James Jithin
James Jithin

Reputation: 10565

For me, the execution was not breaking at the breakpoints set in an inner class.

Did the following steps and it worked:

  1. From the menu items, Run > View Breakpoints
  2. On the Breakpoints dialog, uncheck and check the box for all breakpoints, named Java Line Breakpoints

enter image description here

  1. Click on Done

When I came across this issue again, had to do the above steps to get it working.

IntelliJ IDEA Version Details:

About IntelliJ Screen

Upvotes: 0

Crystal.Q
Crystal.Q

Reputation: 1

Disable breakpoint button

As shown in the picture above. You can check whether the breakpoint is disabled, the disabled breakpoint button will be grayed out there.

Upvotes: -2

Dinesh Kumar
Dinesh Kumar

Reputation: 3142

  • Here is what I did.
  • My code was within an anonymous class where the debug point would not get the tick mark.
  • I extracted the code to a new instance method of the main container class. Then I was able to set debug point in the new method.

Upvotes: 0

Kedar Brooks
Kedar Brooks

Reputation: 541

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.

Upvotes: 38

user11 7532
user11 7532

Reputation: 1

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

Upvotes: 0

hamza
hamza

Reputation: 31

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.

Upvotes: 0

M ONeill
M ONeill

Reputation: 49

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.

Upvotes: 0

user1419261
user1419261

Reputation: 944

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

Upvotes: 0

Manu Yadav
Manu Yadav

Reputation: 11

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

Upvotes: 1

user2301281
user2301281

Reputation: 787

Rebuild solved my problem.

clean & rebuild

Invalidates caches/restart if necessary

Upvotes: 2

Bero
Bero

Reputation: 1070

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 Android gives error "Cannot fit requested classes in a single dex file"

Upvotes: 0

Sizons
Sizons

Reputation: 688

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.

Upvotes: 12

Stypox
Stypox

Reputation: 1200

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.

Upvotes: 1

Abhay Maniyar
Abhay Maniyar

Reputation: 129

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.

Upvotes: 1

KayV
KayV

Reputation: 13835

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.

Upvotes: 4

kumar
kumar

Reputation: 595

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.

Upvotes: 0

MattG
MattG

Reputation: 6405

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.

Upvotes: 4

Related Questions