Eclipse里调试时遇到Source not found应该怎么办

简介: Eclipse里调试时遇到Source not found应该怎么办

When you are debugging in Eclipse, sometimes when you debug into a method, you will meet with “Source not found” message, for example below.



image.pngimage.png

image.pngimage.pngIn my example, this is because the corresponding source code for AbstractTypeHierarchyTraversingFilter does not exist in local workspace. The source code could not be automatically downloaded via “Maven -> Download Sources”.


[Note] This very issue in this example could also be resolved by changing dependency configuration in pom.xml. Please read this blog about what exactly should be defined in pom.xml if different Spring component is planned to be used in your application. In my example, after I add the missing dependency “spring-core” in pom.xml and re-download source via Maven plugin, the source code is then visible in debugger.


image.png

image.png

Solution

(1) Google with keyword as below:image.pngClick the first hit web page.

(2) Go to the corresponding download page for your spring framework version:Then make a zip file based on this folder.

(4) Click “Change Attached Source…” to load the zip file created in step3.

Then make a zip file based on this folder.

(4) Click “Change Attached Source…” to load the zip file created in step3.You could find your Spring version in pom.xml, dependency block:image.png(3) Download the .java source file.

Create a series of nested folders whose hierarchy exactly match the package declaration in java file. In my example, the folder structure should look like below:


image.png

image.png


Then make a zip file based on this folder.

(4) Click “Change Attached Source…” to load the zip file created in step3.image.pngimage.png

After that the source code of AbstractTypeHierarchyTraversingFilter is visible in debugger now.image.png


相关文章
|
8月前
|
Java Android开发
在用 Eclipse 搭建 SAP Commerce Cloud 调试环境时,错误和正确的 buildfile
在用 Eclipse 搭建 SAP Commerce Cloud 调试环境时,错误和正确的 buildfile
44 0
|
8月前
|
Android开发
SAP Hybris Commerce Cloud Accelerator Storefront 在 Eclipse 中的调试
SAP Hybris Commerce Cloud Accelerator Storefront 在 Eclipse 中的调试
30 0
|
11月前
|
NoSQL IDE 开发工具
Eclipse配合GDB和jlinkGDBServer仿真调试STM32
Eclipse配合GDB和jlinkGDBServer仿真调试STM32
|
12月前
|
Android开发
Eclipse 导入项目提示No projects are found to import解决办法
使用Eclipse导入项目时遇到No projects are found to import提示的解决办法。 这是因为导入的文件里面缺少两个文件: .classpath .project 在这里三种方案: 1、其他项目中直接复制这两个文件,然后更改一下“.project”文件中的项目名即可 2、在Eclipse中新建一个项目,与需要导入的项目名一致,然后将项目代码文件直接复制到新项目中即可 3、或者自己新建文件填入以下信息:
492 0
|
Java 程序员 开发工具
Eclipse 答疑:如何使用 Eclipse 进行断点(Breakpoints)调试?
Eclipse 答疑:如何使用 Eclipse 进行断点(Breakpoints)调试?
421 0
Eclipse 答疑:如何使用 Eclipse 进行断点(Breakpoints)调试?
|
XML Java 应用服务中间件
eclipse关于xml文件有两种方式显示 Design方式-图形化方式,Source-源码方式
eclipse关于xml文件有两种方式显示 Design方式-图形化方式,Source-源码方式
1028 0
eclipse关于xml文件有两种方式显示 Design方式-图形化方式,Source-源码方式
|
Java 程序员 Android开发
Eclipse常用快捷键和调试方法
Eclipse常用快捷键和调试方法
237 0
|
开发工具 Android开发 开发者
Eclipse 开发工具(debug 调试)|学习笔记
快速学习 Eclipse 开发工具(debug 调试)
|
NoSQL 开发工具 Android开发
【嵌入式开发】 嵌入式开发工具简介 (裸板调试示例 | 交叉工具链 | Makefile | 链接器脚本 | eclipse JLink 调试环境)(三)
【嵌入式开发】 嵌入式开发工具简介 (裸板调试示例 | 交叉工具链 | Makefile | 链接器脚本 | eclipse JLink 调试环境)(三)
271 0
【嵌入式开发】 嵌入式开发工具简介 (裸板调试示例 | 交叉工具链 | Makefile | 链接器脚本 | eclipse JLink 调试环境)(三)
|
Go 开发工具 Android开发
【嵌入式开发】 嵌入式开发工具简介 (裸板调试示例 | 交叉工具链 | Makefile | 链接器脚本 | eclipse JLink 调试环境)(二)
【嵌入式开发】 嵌入式开发工具简介 (裸板调试示例 | 交叉工具链 | Makefile | 链接器脚本 | eclipse JLink 调试环境)(二)
155 0
【嵌入式开发】 嵌入式开发工具简介 (裸板调试示例 | 交叉工具链 | Makefile | 链接器脚本 | eclipse JLink 调试环境)(二)