找不到我打开的文件的源 [英] Source not found for a file that I have open

查看:109
本文介绍了找不到我打开的文件的源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某些原因,当我调试正在编辑的特定类时,Eclipse为该类打开一个新的选项卡,表示找不到源。同时,来自其他类的调用堆栈的方法工作正常。此外,当我使用我的源代码返回到正确的选项卡时,我可以鼠标悬停变量并查看它们的值。但是每次我走过来,它会弹出到源未找到的标签。我该怎么办?

源未找到截图http://i52.tinypic.com/15dats2.png

For some reason, when I'm debugging a particular class that I'm editing, Eclipse opens a new tab for that class, saying "Source not found." Meanwhile, methods on the call stack from other classes work fine. Furthermore, when I go back to the correct tab with my source, I can mouseover variables and see their values. But every time I step, it pops over to the Source not found tab. What should I be trying out?
Source not found screenshot http://i52.tinypic.com/15dats2.png

修改 Doh!我只需要将该项目添加到源查找路径。这是一个不在源查找路径(而其依赖项目)的新项目。

Edit Doh! I just needed to add that project to the source lookup path. It was a new project that wasn't in the source lookup path (while its dependency project was).

推荐答案

通常,用于启动调试会话的类路径不包括项目本身(因此不包括项目的源)。很可能它是明确地包括项目生成的.class文件,几乎从来不是你想要的。

The cause of this is usually that the classpath used to launch the debug session is not including the Project itself (and thus not including the Project's source). Most likely it is including the generated .class files of the Project explicitly, which is almost never what you want.


  1. 检查您正在使用的启动配置的类路径设置启动应用程序进行调试。

  1. Check the classpath settings of the Launch Configuration you're using to start the app for debugging.

转到软件包资源管理器,右键单击项目,然后选择属性 。在新建对话框中,选择Java Build Path,并在其中添加Libraries。在每个lib树中都有一个名为源附件的节点,这是一个指定源文件位置的节点。

Go to Package explorer, right click on your project and select 'Properties'. In the new dialog you choose 'Java Build Path' and there the register 'Libraries'. In each lib tree is a node called 'Source attachment', that's the one to specify where the source files are.

这篇关于找不到我打开的文件的源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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