Double-clicking a line in logcat that’s part of a stacktrace will normally open the corresponding .java file with the relevant line highlighted. Sometimes, though, it will open the corresponding .class file instead. This file can’t be edited, so I have to take an extra step to open the .java file.
Is there any way to prevent .class files from being opened in the Eclipse editor?
The solution is to mark folders containing .class files as derived resources: right-click on each of your output folders (e.g.,
binandgen), click Properties, and check the “Derived” box.As a bonus, go to the Open Resource screen (Ctrl+Shift+R). Locate the small black triangle near the top-right corner. Click the triangle, and then uncheck “Show derived resources”. This has the added benefit of hiding .class files when you use the Open Resources screen.
Working well on Eclipse Juno with ADT 20.
EDIT: A related problem is pressing F3 (Open Declaration) and having Eclipse open a class file. A (slightly kludgy) solution for this problem is here.