Unable to install breakpoint due to missing line number attributes

Unable to install break points in eclipse.
This is a very common error with eclipse. When you try to set a break point, eclipse says “unable to install breakpoint due to missing line number attributes”.

Description of the error

Can not set the break point. A dialog box appears with the error message like

Unable to install breakpoint in xyz class due to missing line number attributes. modify compiler options to generate line number attributes.

Reason: Absent line number attributes in generated class file.

Solution
Follow this steps if you are compiling classes using eclipse

1. If you are compiling using the eclipse. Verify the class file generation options.

Go to windows > preferences > Java > compiler screen.

Make sure that add line number attributes to generated files (used by debugger) check box is checked.

If you don’t know, what other options are. Check all other three check boxes also.

Eclipse - preferences

Eclipse - preferences

Follow this steps if you are compiling using ANT

Look into the build file and make sure that debug attribute is set to true in javac task

<javac¬† debug=”true” srcdir=”” destdir=””>

Set debug=”true” and build again.

<javac srcdir=””¬† destdir=”” verbose=”false” debug=”true” debuglevel=”lines,vars,source”>

That’s it !! Try setting the break point again.

About these ads
Leave a comment

18 Comments

  1. Hi,

    I am fine setting breakpoints in my own code.

    Howevere, I want to put a breakpoint in java.lang.System setProperty() method
    and I get this same error.

    Any ideas ?
    Thx.

    Reply
  2. Steffi

     /  September 9, 2008

    Hi there,

    I had the same problem when I tried to set a breakpoint in java.net.DatagramSocket.

    What I foudn wrong in my setup is, that I had the wrong src.zip attached.

    To ensure, you have the correct src.zip, do this:
    Window->Preferences->Java->Installed JREs
    Select your JRE and click “Edit”.
    On the “Edit JRE” screen select the entry for rt.jar and click “Source Attachment”
    Make sure, your src.zip location is correct/present.

    For me I used as JRE C:\Program Files\Java\jdk1.6.0_04\jre and with that my source attachment was in C:\Program Files\Java\jdk1.6.0_04\src.zip.

    I had previously been pointing at a wrong version of src.zip (wrong path, wrong JDK)

    Hope this helps!

    Reply
  3. jody

     /  October 29, 2008

    I am having the same problem in my code even though I have checked like it is in the picture. This only happens for one of my apps. DEBUG works for the rest.

    ?

    Reply
    • Aruna

       /  February 24, 2010

      Hi I user maven for building my web application and I too seem to experience the same problem. Please let me know if you were able to get it working.
      Thanks

      Reply
  4. Hi buddy,

    Thanks for the post, you saved a lots of time for me.

    Reply
  5. George

     /  February 17, 2009

    That’s cool, problem solved for me!

    Reply
  6. Nitin Talwar

     /  February 19, 2009

    Hi
    This is really cool. Thanks a lot. :)

    Reply
  7. Robert

     /  April 26, 2009

    Hi there,

    your comment on adding the entry debug=”true” to the Ant build file solved it for me. Thank you very much, great post !

    Regards
    Robert

    Reply
  8. Ravi

     /  April 26, 2009

    Steffi, Thank you for posting your findings, it solved problem for me.

    Reply
  9. J

     /  May 6, 2009

    FINALLY!!!!!
    after sooooooooooo many months I have been able to debug my .java files using ant..
    all thanks to ur post :)

    Reply
  10. Love it!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    For me, it works with debugging jnlp app as well :-) Thank you for your post!!!!!!!!!!!!

    Reply
  11. Acharya

     /  September 2, 2009

    hi,

    I have done the above. I am not compiling using ant but I am still getting the same issues. Can you please help me on the same. I am using eclipse galileo and oepe plugin for my weblogic integration.

    Regards,
    Acharya

    Reply
  12. Anurag k

     /  September 16, 2010

    It works for me.

    Thanks a lot snimavat!!

    Reply
  13. The works for me! Like to thank Snimavat. I was using Fitnesse browser test that talks to port 1044 of Eclipse RemoteDebug. I recompiled and deploy after setting the debug=”true” and it lighted up. This is after 1 whole day of hacking when i gave up and google instead.

    Reply
  14. Jason S

     /  April 7, 2011

    Thanks for your posting, Steffi. That works for me.

    Reply
  15. Deepthi

     /  April 29, 2011

    I am using Ant to build, with debug=”yes”, Glassfish App sever with multiple domains,But, deployed application on one domain. Using Eclipse Helios Service Pack 2,Windows 7.

    I checked
    Window->Preferences->Java->Installed JREs
    and
    Window->Preferences->Java->Compiler
    and
    clean builds-Many times
    and
    Exit Eclipse, Restart Machine-Many times
    and
    eclipse plugin cleaning

    But, no use.

    I get following error when I try to debug from IDE or Remote Debugging.

    “Unable to install breakpoint in xyz class due to missing line number attributes. modify compiler options to generate line number attributes.”

    Following is my EclipseConfiguration Settings

    -startup
    plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
    –launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.2.R36x_v20101222
    -product
    org.eclipse.epp.package.jee.product
    –launcher.defaultAction
    openFile
    –launcher.XXMaxPermSize
    256M
    -showsplash
    org.eclipse.platform
    –launcher.XXMaxPermSize
    256m
    –launcher.defaultAction
    openFile
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Xms256m
    -Xmx1024m

    Any help is appreciated.

    Reply
  16. Abhijith

     /  May 5, 2011

    Thanks for the post. Even after doing all this, I was still facing same issue. On further investigating, I found that the build path of the main method project had reference to jar file and the source files, the order of included jar file was before the source files. So, eclipse was looking for classes with line number inside the class files of the jar and not that of the source.
    Bottom line: If above steps doesn’t work, then recheck the build path to make sure debugger is looking for eclipse generated class file.

    Reply
  17. Anil Sahu

     /  January 10, 2012

    Thanks a lot for the information.If the above solution didn’t work ,check your Build.xml javac debug parameter,the debug value should be on. as given below.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: