1

Eclipse provides an opportunity to view java source code by using Source attachement in project's Java Build properties, but is it possible also to debug java source code?

I try to install breakpoint inside some java .class file and get :

Unable to install breakpoints in java source file due to missing line number attributes

teoREtik
  • 7,886
  • 15
  • 46
  • 65
  • 4
    Yes, but only if the .class files were built with the correct options to include debugging information and line numbers. – Jim Garrison Mar 28 '12 at 05:44
  • 2
    if the .java file is not compiled with -g , no line number info will be compiled into .class. so the class file not know which line in source is the instrument comes from. – jilen Mar 28 '12 at 05:46
  • @JimGarrison can you explain a bit more how to do that? Are there any options in Eclipse or in JDk while compiling the java file or some thing else? – Bagira Mar 28 '12 at 05:50
  • @JimGarrison Actually I tried to modify Eclipse Java Compiler options as described in this post: http://stackoverflow.com/q/957822/556337, but that gives me no effect. – teoREtik Mar 28 '12 at 05:57

2 Answers2

4

You may have the compiler set to include debugging information in YOUR class files, but the class files in rt.jar weren't compiled that way. You need to either recompile all the source for the classes in rt.jar (not for the faint of heart), or download a debug build of the jdk.

PVR
  • 2,534
  • 18
  • 38
-1

Try to install a Java decompiler like Jad...

  • Jad does not enable you to debug your Java class files... Only to view the content in an intelligent way. The original class still have to be compiled with debug enabled as stated by @Ranna – Tonny Madsen Mar 28 '12 at 07:43