Method implementation
Answered
Hi. I'm watching some tutorials and the author can go to method implementation by ctrl +f12. I have a debian and can go only to the place where there is written {code implementation} no matter what I press, ctrl+f12, ctrl+alt+b. How can I get to place where I can see how methods like equals or compare work? Thanks.
Please sign in to leave a comment.
If I press ctrl and method's name I can see only method implemented by me, not how it works.
Hi. You need to have JDK source attached at File | Project Structure | SDKs - Sourcepath.
Thanks, will try it.
Well, I choose /usr/lib/jvm/java-1.11.0-openjdk-amd64 but still I go to TreeSet.class with useless info "code compiled" while author goes to TreeSet.java
And how can I see all classes' methods inside TreeSet.java, for example?
Make sure that <Module source> entry is the first one in the table at the Dependencies tab of each module (Project Structure dialog).
Ok, i made it first, still, after holding ctrl and pressing with a left button on ceilingkey() I went to Navigablemap INTERFACE with no useful code.
@Lovesave could you please provide your project source, so I could check it?
What do you mean by project source?
I mean zip archive of the project you are experiencing the problem with, or any other project suitable to reproduce a problem.
https://dropmefiles.com/KNEMP
Hope that's what you asked about.
Do you have sources configured for the JDK here?
What specific method/class implementation are you trying to go into?
Yeah, I guess. What exactly should be choose there?
Any method/class I'm going into says no documentation available.
To be more precise
Implementation of methods is not available.
Share the screenshot of the JDK sourcepath configuration.
https://dropmefiles.com/9oLM7
It's not showing the sourcepath tab and you have 2 different JDKs defined. It could be that your project is set to use a different JDK. Please clarify which one is actually used and show the sources tab.
ok, well sorry, Im just starting to use intellij
here it is I hope https://dropmefiles.com/mwFlF
>>> Please clarify which...
Ok, how can I do that?
The sourcepath doesn't look correct, try reinstalling OpenJDK or Oracle JDK from scratch and then add it to IntelliJ IDEA, see my previous screenshot showing multiple entries for the sourcepath. JDK distribution you are using now doesn't seem to contain any sources.
Ok, I did it, but still "no implementation... "
Can't I put manually paths for sourcecode?
See https://askubuntu.com/a/1104463/9280. Once you install JDK sources, you can add them to the IDE JDK sourcepath configuration.
God bless you.