Eclipse断点调试报错Absent Line Number Information解决办法

mac2026-01-15  3

Eclipse中在rt.jar包中打断点,Debug时报错:

Unable to install breakpoint in java.util.regex.Matcher due to missing line number attributes. Modify compiler options to generate line number attributes. Reason: Absent Line Number Information

并且发现下面这段代码调试时(第五行),按F5快捷键与F6是一样的效果,并不能跳入Matcher类中

String str = "abcsdfabcsddfabc"; String regex = "abc"; Pattern p = Pattern.compile(regex); Matcher m = p.matcher(str); m.find(); m.group();

原因:

当前工程build path的jre的包不是JDK的jar包,需要做如下修改:

windows -> preferences -> java -> Installed JREs

进入工程目录:

 

点击Finish,问题解决

 

最新回复(0)