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

4
  • 4
    Yes, but only if the .class files were built with the correct options to include debugging information and line numbers. Commented Mar 28, 2012 at 5: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. Commented 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? Commented 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. Commented Mar 28, 2012 at 5:57

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

-1

Try to install a Java decompiler like Jad...

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.