I am running a Maven project and while trying to debug the application, in some lines I'm getting an error No Executable line found at <line no> error even though the code gets executed. I have tried File->Invalidate Cache / Restart method. Appreciate any solutions.
IntelliJ IDEA version: 2018.2.4
Thanks in advance.
Try checking what configuration you are running, I was having similar problem when I didn`t set the configuration right.
You can also use the Run with coverage to see where the code is going :)
Hope this was helpful.
Related
[here is a photo of my workspace [1]: https://i.stack.imgur.com/LdL3r.jpg
I am wondering if there is a setting in eclipse that will highlight and follow the line of code that is being ran when I compile a program so that I can follow it and see in real time where the code has issues. thanks!
Debug can help you track which part of your code is running
I have a Java gradle project in Intellij that I want to debug using breakpoints. When I press the green run button, everything runs fine. When I press the debug button, it still runs fine, but no breakpoints get hit. My run configuration looks like this:
I also tried setting the project to build and run using Intellij IDEA like this, but this did not help either (it also does not work when I select "gradle"):
What steps are needed to fix this? The last questions on this topic unfortunately did not manage to solve this problem.
I work with Intellij 2021.1.2 and gradle 6.8.
According to the comments posted by dan1st and CrazyCoder, what I was trying to do was not a good idea and it is better to debug the java project directly.
Have you tried enabling the "Debug all tasks on the execution graph" option? This help me to get debugging to work correctly
I'm running a simple java project on Android (using Eclipse ADT).
During debugging I see that a value is not set correctly.
I think this screenshot says it all:
Any idea what can cause this?
Thanks a lot,
Omer
After a lot of struggles what solved the problem for me is the following:
Project -> clean , like Simon suggested.
Restart eclipse.
Fix build path (after clean , I got error in my build path not refrencing the JRE).
Fix android target version. (After clean I got some error on the target).
Save files.
Restart eclipse (again).
This was one of the strangest things I've encountered as a programmer,
and I'm not really sure until now what the problem was and which of the above steps helped to fix it.
So , I've decided to write all of the steps, hoping it might do some good to some other pour soul.
Simon- Thanks again.
I am having a problem with Eclipse where I can run my program just fine, but when I try to start the debugger, I get this message
The picture is a little hard to make out, but instead of getting the normal debugging window, instead it says it is throwing a ClassNotFoundException, and is trying to dislay the source for Launcher$ExtClassLoader.
The thing that really baffles me though is that I can run the code just fine, it is only when I click the debug button that I have the problem.
I have also tried debugging at the command line with JDB, and I got the same error.
So far, I have tried Reinstalling Eclipse and downloading (what I believe to be) the correct Java Development tools for Mac OS X.
I have no idea what else I can try, so any help would be greatly appreciated. Let me know if there is any other information I can provide.
Source not found might be legitimate for dynamically loaded code (e.g. Maven).
There are three workarounds known to me (after months of search):
Connect to a running JVM with the debugger and you will see the code.
Use Dynamic Source Lookup plugin for Eclipse from here:
https://github.com/ifedorenko/com.ifedorenko.m2e.sourcelookup
Use run-jetty-run Maven plugin
http://code.google.com/p/run-jetty-run/
I prefer and recommend 3. It works and starts webapp much faster than jetty:run.
Unfortunately 2. didn't helped me as it has issues with Windows paths with spaces.
I have filled an enhancement request on Eclipse Bugzilla and if you agree this issue "Source not found" should vanish forever, please vote for it here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=384065
Do you have the sources for the files that you are using. If you are using Maven (M2Eclipse) you could download the sources. This might solve the problem.
Otherwise you could go and manually attach your sources. Here is how you manually attach sources.
Next you have to attach the sources-
Hope this helps
The "source not found" is a red herring - there may simply be no way to get access to the source that is throwing the error, because it is deep in the guts of the debugger's class loader.
The better question, then, is, "Why is scottrice.ChessPuzzles.ChessPuzzleDriver not being found?" The only possibility that occurs to me at the moment is that something might be weird in your debug configuration. Did you debug the program by just right-clicking a file with a main() and choosing "Debug As" -> "Java Application"?
I've made the terrible mistake of telling Netbeans always to ignore compilation errors when running my Maven application.
Now that I want to revoke this, I can't seem to find an option anyway in the various configuration panels.
Does somebody know where this option can be changed ?
TIA !
Jan
For NetBeans 8.0.2 (in my case):
C:\Users\username\AppData\Roaming\NetBeans\8.0.2\config\Preferences\org\netbeans\modules\java\source\BuildArtifactMapperImpl.properties
file contains:
askBeforeRunWithErrors=false
Set to true or file can be deleted, to reset.
Don't bother - found it after making a directory diff :
Stop Netbeans, remove the file underneath and start Netbeans again.
.netbeans/7.0/config/Preferences/org/netbeans/modules/java/source/BuildArtifactMapperImpl.properties
Simple, no ? :-)