Eclipse java调试:源未找到 [英] Eclipse java debugging: source not found

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

问题描述

在eclipse中调试java应用程序时,我会收到一个源找不到错误,两种情况:

While debugging a java app in eclipse I receive a "Source not found" error in two cases:


  • 进入已导入的不同项目中的文件

  • 进入已安装的maven存储库中的文件

文件在那里,但eclipse不会进入他们,而是显示一个按钮附加源

The files are there, but eclipse won't step into them, instead it shows a button to "attach source"

我尝试附加(打开一个对话框来定义一个变量?!),eclipse已经跳转到该文件,但调试器无法检查任何变量。另外手动附加每个依赖的源是不实际的,因为在我的情况下有成千上万的依赖关系文件。

I tried attaching (which opened a dialog to define a variable?!) and eclipse did jump to the file, but the debugger could not inspect any variables there. Also manually attaching the source for each dependency isn't practical, as in my case there are thousands of dependency files.

我是新来的eclipse \\ java 所以解释为什么会发生这样的事情+如何解决这将有助于很多!

I'm new to eclipse\java so an explanation of why this is happening + how to resolve this would help a lot!

推荐答案

Eclipse调试与程序中实际加载的课程一起工作。

Eclipse debugging works with the class actually loaded by the program.

您描述的症状听起来像项目中没有找到的类,但是在没有调试信息的发布jar中,在您正在使用的项目之前找到

The symptoms you describe sounds like the class in question was not found in the project, but in a distribution jar without debug info found before the project you are working with.

这可能有几个原因,但是看看找到显示此行为的类的位置(请查看导航窗格中的标识)。您很可能需要更改项目的构建路径,以避免使用此jar并使JVM使用项目。

This can happen for several reasons but have a look at the location where the classes showing this behaviour is found (look in the navigation pane to identify it). You will most likely need to change the build path of the project to avoid using this jar and have the JVM use the project instead.

这篇关于Eclipse java调试:源未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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