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"?
Set a breakpoint in your main class by clicking in the left margin of the line where you want to set the breakpoint. The line with the breakpoint is highlighted in pink. Right-click the project's node again and choose Debug Project. The target should run and start execution of the program.
A Java program can be debugged simply by right clicking on the Java editor class file from Package explorer. Select Debug As → Java Application or use the shortcut Alt + Shift + D, J instead. Either actions mentioned above creates a new Debug Launch Configuration and uses it to start the Java application.
If the class file contains debug attributes, you can debug it in the Eclipse Class Decompiler Viewer. There are two ways to debug a class file. The first way is to set the decompiler preference, and to realign the line number. The second way is to check the debug mode in the decompiler menu bar.
Enable JVM DebuggingClick Java > JVM Settings tab. Under Debug Java Settings, select the Enable Debug checkbox. Provide JVM options as necessary by clicking the New button. If you substitute suspend=y, the JVM starts in suspended mode and stays suspended until a debugger attaches to it.
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.
You have to set the source path for that jar/library. Is done in the Options->java build path if I racall correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With