Reputation: 5360
In eclipse workset I have an android library and an application which uses this library. When I set a breakpoint in java file from application debugger stops and java file is available. But when I debug depending library instead of opening file with java extension file with "class" extension is opened in debugger. Is it possible to make eclipse open "java" file instead of "class"?
Upvotes: 8
Views: 11142
Reputation: 32895
Right-click on the project and choose Properties, then select the Java Build Path section. On the Libraries tab you'll find a list of the JARs that the project is using; expand the JAR and you'll see a place for the "Source attachment." Select that and then use the Edit button to point Eclipse to where the source code lives.
Upvotes: 9
Reputation: 2703
You have to add the sources explicitly to your build path in eclipse. If you are using maven you can put it in your settings xml:
<properties>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</properties>
Upvotes: 1
Reputation: 4608
Yes, you have to add the source code in the lib's properties - then both the debugger and the code editor (when you ctrl+click) will show java code instead of bytecode.
Upvotes: 1
Reputation: 6863
You have to set the source path for that jar/library. Is done in the Options->java build path if I racall correctly.
Upvotes: 1