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
-
4Yes, but only if the .class files were built with the correct options to include debugging information and line numbers.Jim Garrison– Jim Garrison2012年03月28日 05:44:49 +00:00Commented Mar 28, 2012 at 5:44
-
2if 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– jilen2012年03月28日 05:46:54 +00:00Commented Mar 28, 2012 at 5: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– Bagira2012年03月28日 05:50:21 +00:00Commented Mar 28, 2012 at 5:50
-
@JimGarrison Actually I tried to modify Eclipse Java Compiler options as described in this post: stackoverflow.com/q/957822/556337, but that gives me no effect.teoREtik– teoREtik2012年03月28日 05:57:04 +00:00Commented Mar 28, 2012 at 5:57
2 Answers 2
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.
Comments
Try to install a Java decompiler like Jad...