Deferred breakpoints: when are classes loaded

六月ゝ 毕业季﹏ 提交于 2019-12-07 18:33:52

问题


I am trying to debug maven with: jdb -attach 8000, after using mvnDebug.
I try to put breakpoints, but get:

main[1] stop in DeployMojo.DeployMojo
Deferring breakpoint DeployMojo.DeployMojo.
It will be set after the class is loaded.
main[1] stop at Dependency:66
Deferring breakpoint Dependency:66.
It will be set after the class is loaded.

When I run, the breakpoints are not called. I have the sources (generated with a maven command), but how can I make them available to the debugger?
Is there a class loader where I could put a breakpoint?


回答1:


This may happen because your class names are wrong or because you omitted the package. If class Dependency is in package com.my.package, then break in class com.my.package.Dependency and not in Dependency.




回答2:


I was using jdb -attach -sourcepath ~/path/to/project/main/java. Turns out jdb doesn't like the ~ and needs jdb -attach -sourcepath $HOME/path/to/project/main/java or the absolute path.



来源:https://stackoverflow.com/questions/10911704/deferred-breakpoints-when-are-classes-loaded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!