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.
0
21 comments
Avatar
Permanently deleted user

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

0

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

0
Avatar
Permanently deleted user

Thanks, will try it.

0
Avatar
Permanently deleted user

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

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

0
Avatar
Permanently deleted user

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

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

0
Avatar
Permanently deleted user

What do you mean by project source?

0

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

0
Avatar
Permanently deleted user

https://dropmefiles.com/KNEMP

Hope that's what you asked about.

0

Do you have sources configured for the JDK here?

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

0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

To be more precise
Implementation of methods is not available.

0

Share the screenshot of the JDK sourcepath configuration. 

0

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
Avatar
Permanently deleted user

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

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
Avatar
Permanently deleted user

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

0

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

0
Avatar
Permanently deleted user

God bless you.

0

Please sign in to leave a comment.