Eclipse Failed to set breakpoint

So, a couple of weeks ago, my Eclipse IDE no longer allowed me to debug my application remotely, saying that it could not set breakpoints because line numbers were not displayed ... The problem is that my Eclipse is configured to display line numbers (which I regularly use in my daily development)

I did some research and found that sometimes this involves using ant to create projects and configure debugging in javac. I made sure that debugging is installed in my build.xml target, but it still won’t let me debug the same error.

And now, to add insult to the injury, I clicked on the box that says “Do not show this message again,” so now I will never know if I really debug my program when I try, or if it failed, and an error message just didn't display.

Does anyone know how to fix this? Or at least know how to switch this error message to go back so that I can determine if / when I will fix it?

+6
java eclipse
source share
5 answers

To re-enable the message: Preferences => java => debug. it’s at the bottom of the screen: “Warn me when you cannot set a breakpoint for missing line number attributes”

For the problem of setting breakpoints, try adding -g to your javac command line in ant (debug attribute of your compilation task, http://ant.apache.org/manual/Tasks/javac.html )

In the end, check if your project has been configured for JRE instead of JDK in eclipse.

+13
source share

This error can also be generated if there are incorrect (outdated or damaged) breakpoints in the Eclipse workspace. In the Breakpoints view, find breakpoints that can be set in classes that have been moved or deleted, and delete them.

+10
source share

I think you can try adding -g to compilearg in your ant construct.

<javac sourcepath="" srcdir="${src}" destdir="${build}" classpath="xyz.jar" debug="on"> <compilerarg value="-g"/> </javac> 

Also, if you are not sure if breakpoints work, just set a breakpoint at the early point of your code, which, as you know, is executed. you can also add a print statement to ensure that the breakpoint is passed.

+2
source share

The error may be caused by the source code that you have in Eclipse, which does not match the code used to create the application that you are removing remotely. Try rebuilding and restarting the application and updating the source in Eclipse.

+2
source share

I ran into the same problem and the answers @jondissed and @twister did not help, and I am not using the custom ant task, so I tried:

  • Close WAR, EJB, and EAR projects - reopen them - still deployment
  • Close eclipse - reopen, restart the local JBoss server - still deployment error
  • Close eclipse - reopen, restart the local JBoss server - clean JBoss temp / data directories - still a deployment error
  • Undeploy app - remove breakpoints, re-add them redeploy - still error on deploy

What finally helped me was

  • Cancel application deployment. Remove the breakpoints. Expand the app. Re-add a breakpoint.

Debugging now stops at a breakpoint.

Update 1 - apparently, Eclipse just gets angry from time to time, since I only fought it for about 10 minutes, when the above didn't seem to work, and while it popped up, I closed it and it still stopped at the new single breakpoint: - /

0
source share

All Articles