Best way to view source for an external jar dependency?

Newbie here. My project depends on some external jars, but when errors are thrown in them, I'd like to take a look at their source. I have downloaded the source for these jars, but ... where do I put it, how to I get IDEA to know about it, and how do I navigate to it?

Thanks,
Kevin

0
5 comments
Avatar
Permanently deleted user

go to your module settings and in the dependency tab, you'll be able to add the source for each of your libraries.

If your project is maven based though, maven integration will do it for you if you click on the right button in the maven projects toolwindow

0
Avatar
Permanently deleted user

Hello Kevin,

You'll have to attach the sources to the library, use the "Attach sources"
button on the library definition UI. IDEA will go to the sources (if they're
available) when you navigate to library classes in any way (ctrlclick, ctrlN,
stacktrace).

HTH,
Andrei

KM> Newbie here. My project depends on some external jars, but when
KM> errors are thrown in them, I'd like to take a look at their source.
KM> I have downloaded the source for these jars, but ... where do I put
KM> it, how to I get IDEA to know about it, and how do I navigate to it?
KM>
KM> Thanks,
KM> Kevin


0
Avatar
Permanently deleted user

I was wondering if there was a better way - like being able to have Intellij search ibiblio for a source jar and have it download to a special directory and automatically register it. Seems like a good plugin...

0
Avatar
Permanently deleted user

if you're using maven, as seems to suggest your reference to ibiblio, this is all transparent.

0
Avatar
Permanently deleted user

Thanks, Thibaut and Andrei. The maven artifacts download works great. I can't remember if the project creation wizard provided an option to automatically download javadocs and sources for external libraries, but that would be nice.
-Kevin Murphy

0

Please sign in to leave a comment.