找不到我打开的文件的来源

2023-11-29

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

Edit哎哟!我只需将该项目添加到源查找路径中。这是一个不在源查找路径中的新项目(而其依赖项项目在源查找路径中)。


造成这种情况的原因通常是用于启动调试会话的类路径不包括项目本身(因此不包括项目的源代码)。最有可能的是它显式地包含了项目生成的 .class 文件,这几乎不是您想要的。

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

  2. 转到包资源管理器,右键单击您的项目并选择“属性”。在新对话框中,您选择“Java Build Path”,然后注册“Libraries”。每个库树中都有一个名为“源附件”的节点,该节点用于指定源文件所在的位置。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

找不到我打开的文件的来源 的相关文章

随机推荐