Intellij - Debugger Breakpoints not working anymore - java

I was working/debugging normally on my Java-Maven project with IntelliJ 2018.2.1, I then click on Intellij to Stop the app to make some modifications to the code and when I start the application again in debug mode, it (the debugger) simply stopped working.
Now, the application takes about +10+20 seconds to start and when the breakpoints are hit, it simply hangs and do nothing else.
I have tried many of the suggestions posted on Internet, but none of those seems to work. I also tried to Invalidate/Restart the IDE, but nothing.
Now, the breakpoints aren't even marked as valid any more, it only shows the red circle without the tick verification check. And it also extended to all projects, so now none of the projects the debugger works and the same symptoms are in all projects.
If anyone have any suggestion on this, would really appreciate it.

Solved the issue. It ended up being that I am using another application (NetLimiter) to limit the traffic in the network and I limited few days ago IntelliJ to consume only 5 kbps at any time and this was the problem. I simply removed the limitation and the debugger starting working again normally at its usual speed.

This is typically caused because there is a process running that it is connected to but you have no way to find it.
The only way to resolve it is to reboot your machine.

Now, the application takes about +10+20 seconds to start and when the
breakpoints are hit, it simply hangs and do nothing else.
By this syptom I can suggest that you have accidentally added some field or method breakpoint. Please check that there are no field or method breakpoints present in Breakpoints window (Ctrl + Shift + F8). If they exist - remove them.

Related

Why doesn't Android Studio see updates right away?

I am using Android Studio 4.1.1. windows 7. I write in Java. I noticed this feature of the program. Changing something in code, layout or resources. I run the program and see that my changes have not appeared! First comes the thought that I was wrong somewhere. I start looking for an error. I don’t find it. I run the program again and it already works as it should. Now I'm used to it. The larger the program, the more often this happens. To be sure of the result, you have to run the program twice each time, because I'm not sure if this time all the changes took effect. It is very uncomfortable. Tell me why this is happening and how to solve this problem.

Eclipse Randomly Deleting My Code when Refactoring

I have been using Eclipse for several years now with lots of ups and downs. Recently, I started having a brand new problem: I spend 20-30 min making changes to my code and suddenly (out of nowhere) Eclipse decides to revert all the changes I worked on in the last 20-30 minutes.
I followed the suggestion in this reply but Eclipse won't even show the new code I wrote in the Local History.
It's beginning to happen so frequently that it is really effecting productivity. One step ahead, two steps backwards. It occurs even when I religiously save my work every couple of minutes - even the "saved" changes are reverted.
Based on a quick analysis it seems this happens most frequently when I try to rename a variable and Eclipse says I need to select a variable (which I did, but that's besides the point) to refractor it. After I click OK in popup, at that point eclipse "undoes" all the code I worked on in the last twenty minutes or so. No questions asked.
Has anyone faced a similar situation? Really thinking of switching to IntelliJ IDEA even though I've been using eclipse for years.
Thanks
UPDATE 1:
I noticed the issue occurs only after I get the following message:
A fatal error occurred while performing the refracting
A local variable deceleration or reference must be selected to activate the Refactoring
UPDATE 2:
I am now able to restore recent edits via Local History. In other words, the recent edits are showing up now in Local History, so this was an oversight on my end. However the primary problem with Eclipse reverting changes when refactoring variable is still present. In other words, I still need to "restore" my work every 20-30 minutes (when refactoring variable that results in fatal error message above) via Local History.
UPDATE 3:
The error also occurs when I try to refactor and get the following message:
Rename Refactoring: Could not a method for project handle "null" with handle identifier..

Practice at localhost contains obsolete methods, Reason: the virtual machine was unable to remove all stack frames running old code

Problem
My code runs without problem but this prompt keeps appearing. I have run into this problem a lot but I just ignored it since the code runs fine. However it's starting to get rather annoying and all the fixes I saw online did not work. I suspect this has something to do with 'hot code replace'.
I also did set "Build automatically".
I saw on some other post that I could disable hot code replace by going to Preferences>Run/Debug, but I found no such option.
Any help is appreciated, thanks!
Apparently I was running in debug, I confused my shortcut keys... Problem fixed lol

How on earth does he debug a running application like this, and more importantly, how can I?

"Debugception!"
You may notice that within the first 15 seconds of this YouTube video (from 1:01:01 to 1:01:16), Markus Persson (aka "Notch", creator of Minecraft) has somehow managed to save/update an application and attach a debugger to it while it was already under the process of being debugged, supposedly all with a simple keyboard shortcut. The previously coded application somehow magically became the newly edited one, and seemingly without relaunching it or spawning a new process... It's possible that this is just some form of locally remote debugging, but something about it just doesn't seem quite right.
I've spent several days Googling and asking around on how he was able to do this, yet to no avail. I've found no such option under Eclipse preferences, and whenever I try to save & debug an already running application, it simply launches a separate instance of the newly updated application, side-by-side with the older, outdated one.
Am I missing something? How was this possible?
How was he able to utilize such an astounding, powerful debugging feature?
Thanks in advance!
Update
Okay, so this appears to be a standard feature specific to Eclipse.
Coming from a background in NetBeans and Visual Studio, I'm astounded that this doesn't seem to exist elsewhere (or at least in NetBeans!)...
This is a built-in feature of Eclipse. If you edit a method while the program is running in debug mode, it will compile the new method, and replace the old method with the new version. If some thread was already running that method, it will jump back to the beginning (AFAIK; this might only happen when the program is paused).
You don't need to re-launch the program or set any special preferences. Just edit and save, and the magic will happen.
Eclipse can't always figure out how to merge your changes into the running program - usually if you changed anything outside a method body (including the method's parameters or return type). In this case, you will get a warning dialog, with the option to stop the program, restart the program or ignore the changes.

How to debug JavaFX

I've just started working with javafx, it seems cool and NetBeans seems much more fun than Eclipse but I find it impossible to debug my application. I've added breakpoints, and I pressed the debug button, I see the debugger is registered to some port but it doesn't cause the application to start.
When I run the application and attach a debugger nothing seems to happen. This is extremely annoying since I am using an external library I've added to my project, and I can't edit its content (since I am getting 'java file cannot be locked as it is read only').
I am very new to java and especially javafx, thank you for your help I sure need it:)
First off, I'd start with downloading the latest version of NetBeans (6.7.1 as of today). Second, NetBeans will let you put breakpoints in places that don't make sense for the language. You're best off putting breakpoints in a function like the run() function and stepping from there.
One more thing: make sure you have your JavaFX project set as the main project if you use that Debug button since I believe that it acts on your main project only.

Categories

Resources