.class文件在调试时打开而不是.java [英] .class file opens instead of .java while debugging

查看:188
本文介绍了.class文件在调试时打开而不是.java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前设置:


  • MainProject 是一个库项目

BranchProject 这是一个新的项目,并且有MainProject作为参考

BranchProject which is a new projects and has MainProject as a Reference

每当我调试并且MainProject中的文件处于焦点(实际上BranchProject只有图形和xml布局更改)时,Debug窗口打开一个只读的.class文件。我想要它打开.java文件,所以我可以直接编辑它。

Whenever I debug and a file from MainProject is on focus (actually BranchProject has only graphic and xml layout changes) the Debug window opens a .class file which is read only. I want it to open the .java file so I can edit it directly.

推荐答案

Skyler从这篇文章的答案为我工作:
打开源代码调试视图在Android R18更新后编辑.class

Skyler's answer from this post worked for me: Opening source code from debug view edits .class after Android R18 update

这是一个总结:
修复是在调试视图中右键单击项目名称,然后从菜单中选择编辑源查找...。从那里,删除默认查找路径。之后,手动添加项目引用的关联项目(而不是jar)。这可以通过单击添加,选择Java项目,然后检查相应的项目来完成。

Here is a summary: The fix is to right click the Project name in the debug view, and select "Edit Source Lookup..." from the menu. From there, remove the Default lookup path. After that, manually add the associated projects (not jars) that your project references. This is done by clicking Add, selecting Java Project, then checking the appropriate projects.

这篇关于.class文件在调试时打开而不是.java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆