如何在Eclipse中进入一个核心的java类方法? [英] How can I step into a core java class method in Eclipse?

查看:147
本文介绍了如何在Eclipse中进入一个核心的java类方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在Java中挖一点,所以我想看看程序在核心类中的执行情况。例如,我想知道如何实现 String.chatAt(),所以我设置了断点并试图进入调试模式。但是我失败了,当程序打开时,我设置了第二行的bp,我使用步骤仍然继续到第三行。

  String a =1231231241241; 
char b = a.charAt(0);
System.out.println(b);

我认为应该进入源代码并显示找不到源,然后给我一个机会附加源文件,对吧?但为什么不能进来?我只能使用 ctrl + right 点击一个方法进入源代码并附上。

解决方案

可能是您的Eclipse未设置为使用JDK运行,可能会以JRE运行。

检查此链接

另外,我可能会建议您尝试使用 Maven 进行Java项目管理,这样可以使生活变得更容易你会掌握它。


Hi I am going to dig a little more in Java so I would like to see how the program executed in the core class. For example, I would like to know how String.chatAt() is implemented, so I set breakpoint and tried to step into with debug mode. But I failed, I set bp at the second line when the program hit it, I used step into it still continue to the third line.

String a = "1231231241241";
char b = a.charAt(0);
System.out.println(b);

I think it should go into the source and show "no source found" and then give me a chance to attach the source file, right? But why it cannot get in? I can only use ctrl+right click on a method to get into source and attach.

解决方案

It might be that your Eclipse is not setup to run with JDK, it might run with JRE instead.
Check this link.
Also, I might suggest you to try and use Maven for your Java projects management, it makes the life so much easier, when you get a grasp of it.

这篇关于如何在Eclipse中进入一个核心的java类方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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