unable to set breakpoint in intellij
Solution 1
File -> Invalidate Caches and Restart helped solve the problem. Thanks Tomasz Nurkiewicz for the directions
Solution 2
Had the same issue while using IDEA CE 15: Removing the Python CE plugin 5.0.143.103 fixed the issue... but no Python parsing! :(
Solution 3
In my case, the issue was caused by PHP Plugin (https://plugins.jetbrains.com/plugin/?id=6610). Even after "Invalidate Caches and Restart", the issue persisted.
Uninstalling that PHP plugin, solved my problem.
Solution 4
By nothing happens do you mean that breakpoint isn't hit? Take a closer look at breakpoint icon. Especially see the difference between
and
icons. The latter indicates the code you run while debugging doesn't have any meaningful instruction on that line.
One of the reasons for such behaviour is when code you run is not the code you see. It can happen when application server can is still running old JAR or something similar. This seems to be the case since you say that breakpoints work in older code.
Solution 5
The solution to fixing breakpoints was adding the wildcard file extension "*.py" to the Python File Types in Python (it must have the wildcard symbol prefix, not just ".py") through taking these steps:
-
Go to:
IntelliJ IDE > Preferences (CMD+,) > Editor > File Types > Recognized File Types
-
Under "Recognized File Types" heading:
Scroll down; Select "Python" (associated Registered Patterns will be shown below)
-
Under "Registered Patterns" heading:
Click "+" icon; Enter "*.py", Click OK (do whatever is necessary to achieve this, including removing/renaming others without the wildcard if necessary)
-
Add breakpoints by:
Select line(s) of code (not an empty line or comment); Going to: Run > Toggle Line Breakpoint (CMD+F8)
-
Configure debugging with breakpoints by going to:
Run > Edit Configurations...; Click "+"; Select "Python"; Add a value for the "Name" property; Select location of the ".py" file to debug (in the "Script" property); Click OK
-
Debug using the breakpoints by going to:
Run > Debug... (Fn+CMD+F9); Wait until it stops at a breakpoint; Inspect variable values shown in the file itself by hovering over variable; Click variables and view the Frame and Variable details in the Debug window by going to: View > Tool Windows > Debug (CMD+5)
Important Note: Initially I tried doing the following but after each one I was still unable to use breakpoints afterward:
-
Removing and reinstalling the Python plugin:
Entering CMD+,; In the dialog window going to Plugins > Install Jetbrains Plugin.. > "Python" > Install
Updating IntelliJ Ultimate edition to the latest version v2016.3.4
- Going to:
File > Invalidate Caches and Restart
user1796650
Updated on July 30, 2022Comments
-
user1796650 almost 2 years
I am trying to set breakpoints, nothing happens for couple of classes that I compiled recently with "mvn install". I am able to set breakpoints to classes which were already built by someone else. Please let me know if anyone knows how to solve it.
-
user1796650 over 11 yearsBy nothing happens I mean I am not even able to set the breakpoint, I don't get that red ball at all.
-
Tomasz Nurkiewicz over 11 years@user1796650: this is also a sign of stale code which is out of sync with what you run. How do you run your code? Have you tried refreshing (whatever you can) in IntelliJ after building and installing?
-
user1796650 over 11 yearsI am not yet running the code, just setting the breakpoints, which I am unable to do. Couple of points to add, I am able to set breakpoint in the same class(say A.java) in eclipse. In intellij if I add breakpoint in some other class which calls a method of A.java then while debugging it enters the correct method in A.java. I am able to correctly step debug after that. But still not able to set breakpoint in A.java.
-
user1796650 over 11 yearsAnother thing is if I right click on any method call in A.java and say Go to declaration, even then nothing happens. It just doesn't go to called method
-
Sachin Verma about 11 yearsThanks @user1796650 . I was facing the same problem and was unable to resolve until I came across your post. I used the Invalidate caches option and it worked magic.
-
Sachin Verma about 11 yearsThanks @user1796650 . I was facing the same problem and was unable to resolve until I came across your post. I used the Invalidate caches option and it worked magic.
-
Neerav about 11 yearsI am having a similar problem. while debugging, intellij is still running the old code. I tried making a fresh build, invalidate caches - but the problem continues.
-
Gary over 8 yearsThank you for this comment. I too couldn't get this working with the invalidate caches workaround, but your comment prompted me to try disabling my plug-ins and found that the line breakpoints started working again.
-
Gary over 8 yearsFYI, in my case it was the Python Community Edition plug-in that was causing the problem.
-
Faraj Farook over 8 yearsThank you.. i was almost going to uninstall the IDE to try a rollback to 14.. Thanks alot..
-
iBiryukov over 8 yearsYou can reinstall Python CE plugin. That fixed the issue for me.
-
Abhishek Tyagi over 8 yearsYes, That seem to solve the problem. It was weird though. 15.0.1 or 15 didnt have this problem, 15.0.2 has it. Thanks.
-
Bruno Santos over 8 yearsParanoia, really! I have my little IDEA Plugin and initially thought that it was because of it. After uninstalling it the issue was still there. Then checked in another system that had no plugins and the issue was not present. So I just went down to next most recent plugin that I had installed which happened to be the Python plugin. I was right to suspect that it was a plugin and happy to know that it wasn't mine causing the problem! :)
-
Hubbitus over 8 yearsDoes anyone report that issue to JetBrains?
-
Jacek L. over 8 yearsThank you so much for this hint
-
stantonk over 8 yearsi also cannot get line numbers to stay turned on...any ideas? :)
-
Kageetai over 8 yearsWow, this worked for me too, but how come the PHP plugin affected my Node.js project? Strange...
-
Bruno Santos over 8 years@stantonk, I have no idea what's preventing your IDEA from keeping line numbers up. But, if I had to guess, it might just be some other plugin you have installed.
-
stantonk over 8 years@BrunoSantos :( yea. never had an intellij upgrade go so poorly :(
-
Bruno over 8 yearsYep had an issue with this today as well, nuking the python plugin did the trick.
-
habitats over 8 yearsThis ought to be the weirdest bug I've encountered in a while. Worked for me too.
-
thinice over 8 yearsWas the PHP plugin for me too
-
Bob S over 8 yearsjust deactivating the php plugin is enough.
-
Dropout over 8 yearsSame for me.. Deactivating the plugin and restarting fixed it.
-
rahulserver about 8 yearsFor me too on intellij idea 15.0