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.
21 comments
Comment actions Permalink

If I press ctrl and method's name I can see only method implemented by me, not how it works.

0
Comment actions Permalink

Hi. You need to have JDK source attached at File | Project Structure | SDKs - Sourcepath.

0
Comment actions Permalink

Thanks, will try it.

0
Comment actions Permalink

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?

0
Comment actions Permalink

Make sure that <Module source> entry is the first one in the table at the Dependencies tab of each module (Project Structure dialog).

0
Comment actions Permalink

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.

0
Comment actions Permalink

@Lovesave could you please provide your project source, so I could check it?

0
Comment actions Permalink

What do you mean by project source?

0
Comment actions Permalink

I mean zip archive of the project you are experiencing the problem with, or any other project suitable to reproduce a problem.

0
Comment actions Permalink

https://dropmefiles.com/KNEMP

Hope that's what you asked about.

0
Comment actions Permalink

Do you have sources configured for the JDK here?

What specific method/class implementation are you trying to go into?

0
Comment actions Permalink

Yeah, I guess. What exactly should be choose there?
Any method/class I'm going into says no documentation available.

0
Comment actions Permalink

To be more precise
Implementation of methods is not available.

0
Comment actions Permalink

Share the screenshot of the JDK sourcepath configuration. 

0
Comment actions Permalink

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.

0
Comment actions Permalink

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?

0
Comment actions Permalink

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.

0
Comment actions Permalink

Ok, I did it, but still "no implementation... "
Can't I put manually paths for sourcecode?

0
Comment actions Permalink

See https://askubuntu.com/a/1104463/9280. Once you install JDK sources, you can add them to the IDE JDK sourcepath configuration.

0
Comment actions Permalink

God bless you.

0

Please sign in to leave a comment.