How can I step into a core java class method in Eclipse?

后端 未结 5 738
暖寄归人
暖寄归人 2020-12-17 02:07

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()

相关标签:
5条回答
  • 2020-12-17 02:27

    To be able to look at the code of libriaries you are using in your project you should configure your build path by attaching the soruces and JavaDoc.

    Source Lookup

    0 讨论(0)
  • 2020-12-17 02:27

    for example in this System.out.println("test") piece of code if you want to step into System class just click on System and click F3 you will be redirected to attach the source code if you haven't already attached.Just attached the src folder of the jdk

    0 讨论(0)
  • 2020-12-17 02:29

    Most likely, you have the "Step filtering" functionality activated.

    When debugging, it can sometimes be a bit annoying when the debugger steps into trivial classes whose internals you were not really interested in. Because of this, you can configure "Step filters". Classes or packages that are added as step filters will be ignored by the "Step into" operation.

    If you want to configure which classes/packages should be included in the step filter, you can go to:
    Window --> Preferences --> Java --> Debug --> Step Filtering
    My guess is that you have a java.* package filter defined there, meaning that the debugger will never step into any class within a package which starts with "java". Uncheck this package filter if you want to be able to step into java.lang.String

    Alternatively, if you want to activate/deactivate step filtering completely, you can do this by clicking the Use step filtering button in the debug view, as shown below:

    Toggling step filtering

    0 讨论(0)
  • 2020-12-17 02:36

    Seems like you dont have the "Source Attachment" set. Go to Preferences -> Java -> Installed JREs. Select the JRE you use and click "Edit", then set the Source Attachment to the src.zip that comes with the jdk by selecting the jars and clicking "Source Attachment" :). You can do this with all of the jars at the same time by selecting them via shift-click.

    0 讨论(0)
  • 2020-12-17 02:40

    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.

    0 讨论(0)
提交回复
热议问题