I am new to IntelliJ (and Stackoverflow) and fairly new to Java,In my application I am using code from jars that in IntelliJ I added as "External Libraries". I also have the source code for those jars, but I rather not compile it (they are huge and complex). Now while debugging my application I would like to step into the library code that is compiled into those jars. How can I set up IntelliJ to do that? Is there another way other that attaching the entire jar library source code to my application code?
-
1Thanks, that did it. For others that might find this useful, I would add that in "dependencies" tab, you need first to select the jar you want to add sources for, then "Edit", then "Attach Sources" – Ascari Mar 21 '10 at 01:56
-
And yes, I don't have enough reputation points to vote the answer... – Ascari Mar 21 '10 at 01:58
-
1You can always **accept** it though. – Péter Török Mar 23 '10 at 22:26
4 Answers
You can attach source code to the library configuration. In the Project Structure dialog where you define which JARs make up which libraries, there is an "Attach Sources..." button that allows you to specify one or more source JARs, ZIPs or directories.

- 53,737
- 19
- 129
- 165
There is another way.If you are in code editor and you are using classes of particular jar, you can CTRL+click on a particular class or method. It will navigate you to compiled code. There will be a tab on top with link "Attach Sources..". There you can specify source.

- 3,516
- 2
- 22
- 47
-
1Don't open wrong folder for source like me! Select specially file under source folder. – Mustafa Kemal Dec 17 '14 at 16:26
-
1
If you are in a maven project right-click pom.xml and download sources and/or documentation
After that you'd be able to see the links into file->project structure->libraries->

- 4,653
- 38
- 47
To download the source, I did a:
mvn dependency:sources -DincludeArtifactIds=package-name
Then I had to restart IntelliJ to make it recognize the sources.

- 1,177
- 15
- 15