从调试视图中打开源$ C ​​$ C的Andr​​oid R18更新后编辑的.class [英] Opening source code from debug view edits .class after Android R18 update

查看:113
本文介绍了从调试视图中打开源$ C ​​$ C的Andr​​oid R18更新后编辑的.class的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我调试我的code在Eclipse中,我生气时,我打开编辑器来找出我不能编辑它,因为我实际上浏览.class文件的来源。我如何获得Eclipse来打开.java文件,而不是.class文件在调试模式?

When I'm debugging my code in Eclipse, I get annoyed when I open up the editor to find out I cant edit it because I'm actually viewing the source of the .class file. How do I get Eclipse to open up the .java file instead of the .class file when in debug mode?

编辑:当我遇到断点的的code,它带给我MyFile.class,而不是MyFile.java,这样我就可以看到的的code,但不能编辑它。

When I hit a breakpoint in my code, it brings me to MyFile.class, instead of MyFile.java, so I can see my code but not edit it.

编辑:我猜它有somethign做Android和ADT R18

I'm guessing it has somethign to do with Android and ADT R18

推荐答案

在我终于找到了一些时间和充分的理由来考虑这个问题的深一点,我会详细一点上Thornbjorn的答案。

After I finally found some time and good reason to look into this issue a bit deeper I'll elaborate a bit on Thornbjorn's answer.

随着最近,谷歌改变了你的Andr​​oid项目打包外部的Andr​​oid库。在ADT R17(我觉得)它开始包装外部项目源成.jar文件,并直接包括他们进入了Android的依赖或/ libs文件夹中的项目。

As of lately, Google changed the way your Android projects package your external Android libraries. In ADT R17 (I think) it started packaging the external projects source into .jar files and including them directly into your project in the Android Dependencies or /libs folder.

现在,当调试器命中断点,它带来了你的源$ C ​​$ c在该.jar,实质上是告诉你编辑一个.class文件。问题是,这个文件是只读的,所以你必须去手动找到你的.java源。 (疼痛)

Now, when the debugger hits a breakpoint, it brings up your source code in the .jar, essentially telling you to edit a .class file. The problem is that this file is read-only and so you have to go find your .java source manually. (Pain)

解决方法是右键点击调试视图中的项目名称,并从菜单中选择编辑源搜索...。从那里,删除默​​认的查找路径。在此之后,手动添加相关的项目(不罐),您的项目引用。这是通过点击添加,选择Java项目,然后选中相应项目的完成。

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.

这篇关于从调试视图中打开源$ C ​​$ C的Andr​​oid R18更新后编辑的.class的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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