Eclipse skipping over breakpoints when debugging java - eclipse

I've been using Eclipse for ages and I use the debugger all the time but recently I've known it to skip over breakpoints while debugging! I've even had it so that I've set a break point on a println I'll see the text come out but not hit the breakpoint. Also sometimes I'll hit a break point consistently in one area of the code but not in others. This never used to happen and I can't work out what I've done to my system to cause this. Has anyone else had any experience of the problem?

What you mention ("-XX:+UseParallelGC") is a workaround for the bug found with jdk6u14 and 15.
As mentionned in "Eclipse SWING app: breakpoint hit only after an uncaught exception is thrown", it is fixed with jdk6u16.

Ahaha,
I've found the solution eventually after a long web trawl. I'm not sure why this happens but other people have seen the problem too and
Window -> Preferences -> Java -> Installed JRE's -> (edit your currently used JRE) -> Edit "Default VM Arguments" box and enter (w/o questionmarks) "-XX:+UseParallelGC"
Generally fixes the problem...

I encountered the same issue. My solution is, you do a clean on the project (Project->Clean) and build again(Project->Build All or Project->Build Project). Upon a successful build, Debug the project again. It will go through the code perfectly (in the proper way).

Related

Problems while setting up the development environment for Eclipse SmartHome

I am having problems with setting up the Eclipse IDE for editing source code of SmartHome on Windows 10. I have done everything as it is described in the Setting Up a Development Environment guide.
However everything works until I open up the workbench. At the first start the so called "setup tasks" will be performed automatically which takes about 5 min. After that I still got like 100 errors of 200 items and a bunch of warnings.
In the official guide they say this might be normal. After performing the "manual setup tasks" however (which can be found under "help" in the menu bar) most errors should be gone, which does not happen in my case. Even after rebuilding all of the loaded projects there are still errors and warnings remaining.
Has anybody had similar issues and maybe a solution for that problem?

Intellisense in IntelliJ no longer working

I'm currently running IntelliJ IDEA 13.1. While running IntelliJ 13 intellisense/autocomplete stopped working. I tried upgrading and it still doesn't work.
I can explicitly invoke code completion using ctrl+space. I looked in Settings->Editor->Code Completion and nothing looks out of place. Is there somewhere else that turns this feature on/off?
For me it was because I did not have a folder marked as Source Root (it appears in blue).
To fix, right click your root source directory -> Mark As -> Source Root.
Check to see if you accidentally turned on Power Save (File/Power Save Mode) I myself just discovered that File/Power Save Mode does turn it off. I was having the same problem and must have accidentally set Power Save Mode to on.
I'm using Mac and when I upgraded to Big Sur my intellisense stopped working.
This is due Big Sur has a shortcut for Input Source. By disabling Mac shortcut, will make Intellisense work again.
You can see the option to disable in mac:
File -> Settings-> Editor-> General -> Code Completion-> Auto pop up code Completion
If other options mentioned is already true for you,try Setting up Sources/Test folder as Sources Root/Test Sources root as it did the trick for me. I had forgot it.
Right click on folder, choose "Mark Directory as" Test Sources or Sources Root, or whatever applicable. :)
Try disabling all plugins you have. I installed Codota and it turns out to be garbage. I uninstalled it and disabled the plugin in IntelliJ and it worked
Had the same problem and none of these helped. What I realized was that on mac, control + space is used by the OS to change language inputs and it overrides intellij. So if you are on mac having multiple input languages on your keyboard, consider changing the shortcut for it :)
I tried all the above option and it did not solve the issue. In my case:
THE ISSUE: node_modules was not loaded in the file structure of the project.
THE SOLUTION: go to explorer(finder/nautilus) find the .idea folder in the project and delete it. Then re-import the project. Once I re imported the project it loaded the node_modules folder as library root
Note: It will take a few seconds for IntelliJ to index all the libraries. You will see a loader on the bottom right next to line number info.
In my case, I restarted the Intellij and everything came back to normal.
Had the same problem until:
Third party JDK installed
Configured in module settings: right click on project name, then "Open module settings" -> SDKs -> "+". Pick the jdk root folder and Idea will take care of the rest.
Re-indexed a bunch of things. It happens automatically, just be patient
For me, it was I hadn't yet set up the JDK.
Type something out, Ctrl+Space to try to autocomplete. If it fails, do Alt+Space and if the option comes up to setup JDK, do that.
In IntelliJ 2017-2 to configure Autocompletion:
Settings -> Editor -> General -> Code Completion
In case this helps anyone; for me it was a windowing glitch of some kind. The suggestions popup showed on the wrong monitor, which I didn't notice the first time it happened.. after a while I saw what was happening. Resizing the window seemed to fix it.
If you're too lazy to restart your machine to fix the issue, you can kill the process taskkill /F /PID pid_number_of_idea64.exe (task manager -- view>select columns>PID) and then open CMD, head over to C:\Program Files\JetBrains\IntelliJ IDEA xxxx.xx.xx\bin, start idea.bat. Let this CMD window open.
Please note that even after executing taskkill, idea64.exe process doesn't disappear from task manager. Try executing the same command again and you'd know that process doesn't exist anymore.
For me the code completion suddenly stopped working because I had nudged the IDEA window slightly off-screen, maybe just a pixel or two, which caused the code completion pop-up to (presumably) appear off-screen. Making sure the application window was fully visible fixed the problem.
In case none of these work for you, if you are using IdeaVim, make sure your ~/.ideavimrc does not override Ctrl+Space, you can check this in vim:
:verbose map <c-space>
In my case, it was set by ~/.vim_runtime:
Last set from ~/.vim_runtime/vimrcs/basic.vim line 208
Thanks #s1n7ax for the tip!
IMPORTANT
If you had your email logged-in on IntelliJ Idea for a while and its token expire the Intellij will suddenly stop working or crash(My Version 2020.1.1).
Do two things.
1. file > sync settings with JetBrains account (log in here)
enter code here.
2. file > Invalidate cache / restart
I'm using Maven project, it works by:
File > Project Structure > Modules > Sources
and then marked java files dir as Sources.
reference link.
Spent hours to fix this problem too. For me, the answer was to disable a plugin.
Which one to disable? Just find out using trial and error since all kinds of plugins can cause errors...
It depends which product, for Intellij I might have to right click and import the .iml file from the root, or in Rider right click the solution file and open that. I'm only making this mistake 4 or 10 more times, and then it is never happening again.

How to debug Eclipse's internal clases

I have a very strange problem with regards to contributing to Eclipse. I have modified bundle org.eclipse.jdt.internal.junit4.runner and just wanted to test it and try it, but for some strange reason my breakpoints in the bundle org.eclipse.jdt.internal.junit4.runner are not working. It sounds to me that there is an internal filtering that cause that these bundles are ignored for breakpoint.
Funny thing is when I add
System.err.println("Did you reach it?"); //$NON-NLS-1$
In the console I can see the text, but the breakpoint is not working...
Any advice would be very welcome.
Look here. Also check whether any packages are excluded in Windows->Preferences->Java->Debug->Step filtering.
Well, I found out the problem but not a complete answer.
The problem is especially related to the org.eclipse.jdt.internal.junit4.runner bundle which launches and an another virtual machine and the code within this VM is not in debug mode, e.g. the first virtual machine is in debug mode and the second is not and that was the reason why my breakpoints did not work. So I guess there is no possibility how to enable debug mode "by eclipse automatically" in the subsequent VMs.
Here is an example of 2 VM from my blog http://blog.chocolatejar.eu/contribution/2014/02/27/better-visualization-junit-failures/

Eclipse #ifdef error using JNI, Android NDK and Vuforia

With Vuforia's ImageTargets sample application, I tried using OpenGL ES 1.1 by setting USE_OPENGL_ES_1_1 to true in jni/Android.mk and uncommenting and changing the corresponding line in AndroidManifest.xml (). After converting the project so that it has a C++ perspective and associating ndk-build and the proper include directories, I could successfully run the application on my Android device.
However, the problem is that once I open up jni/ImageTargets.cpp, I get several errors from Eclipse, all from places where OpenGL ES 2.0 code would execute, the first one being:
Description Resource Path Location Type Symbol 'vertexHandle' could
not be resolved ImageTargets.cpp /ImageTargets/jni line 402 Semantic
Error
Sure enough, vertexHandle is defined at the top of the ImageTargets.cpp, inside the "#ifdef USE_OPENGL_ES_2_0" block. Because USE_OPENGL_ES_2_0 is not defined (per Android.mk), the code should be able to compile successfully, and sure enough, ndk-build does not report any problems. So it seems that only Eclipse reports the problems and when I run the project, Eclipse says, "Your project contains error(s), please fix them before running your application." And thus, I cannot run my application anymore. In a sense, it's kind of strange that this never occurred until I opened ImageTargets.cpp and Eclipse "discovered" the errors.
The best work-around I've found so far is to just delete or comment out those lines (that should not be causing problems because USE_OPENGL_ES_2_0 is not supposed to be defined)... Is there a better way to deal with this problem? Did I miss a setting in Eclipse that should solve this?
I've found a solution: go to the project properties -> C/C++ Build -> Discovery Options -> Check "Automate discovery of paths and symbols"

Hot Code Replace Failed (eclipse)

"Hot Code Replace Failed - add method not implemented".
I get this error message every time I change something in my test class (and save it).
Can't figure out what it means. Can somebody help?
Possibly, you have a test which is still running (in debug mode). Try finishing all tests (you can see them in the debug view: window->show view->debug) and try again...
See this thread:
This means you changed a class while it was debugging an application and it could not update the class for the application while it was running.
The error suggests you may be running an older JVM, i.e. pre-1.4.2 but this error can occur with any JVM if the change is incompatible with the previous version of the class.
Check carefully what JRE you are using in your debug session.
Also check you are deploying classes compiled with the debug attribute set. (see this thread)
Finally, as indicated here:
did you switch "Project->Build Automatically" off?
Hot code replacement works (only?) if automatic build is switched on...
I was running into this issues too. I found a build hiding in the backgound that was giving me fits. Check to make sure you have all tests/builds closed or completed. Nonetheless, you can still run the new code.
Whenever this error message appears it also gives options to terminate or restart. Select Terminate and it will terminate any running debug case which you are unable to locate.
if you have multiple projects involved, and multiple jre's installed, make sure all dependent projects are using the same javac/jre
Make sure your application server JRE and Eclipse JRE version should be same or else it will throw unsupported class version and hot code debug will not work.
I went to the same Problem,But my Debugging session ended hours ago.But still ECLIPSE error kept coming.
So I just simply restart the ECLIPSE IDE, then the problem just solved.