Attaching jdk src to Intellij

I would like to attach the jdk src.zip to a module (it would actually be nicer to do this at a global level for IDEA) and I am not sure if I am doing it right. I have unzipped the src into a folder and added it as an additional source root. This works great for browsing jdk sources but whenever I try to run my application, Intellij has to parse ALL of the JDK sources again. This takes about 30 seconds.

Please tell me there is a better way to do this.

Thanks,

Tony

4 comments
Comment actions Permalink

Hello Tony,

I would like to attach the jdk src.zip to a module (it would actually
be nicer to do this at a global level for IDEA) and I am not sure if I
am doing it right. I have unzipped the src into a folder and added it
as an additional source root. This works great for browsing jdk
sources but whenever I try to run my application, Intellij has to
parse ALL of the JDK sources again. This takes about 30 seconds.


Go to Project Structure dialog, select the "JDKs" node, select your JDK,
select the "Sourcepath" tab, press the "Add" button and select src.zip (it's
actually added there by default, so I'm not sure why it wasn't picked up
automatically for you). You don't need to unpack the archive or add it as
a source root.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


1
Comment actions Permalink

Ok, I figured it out. In the Project view under libraries it will show the JDK. I click on jump to source and at the configuration screen for the JDK's there is an option to change the source path. Whew.

0
Comment actions Permalink

I found Sourcepath tab in File -> Project Structure -> SDKs.

0
Comment actions Permalink

What do you really want to achieve?
If you set up a JDK the regular way (project settings, JDK), IDEA automatically attaches the zipped source.
You can browse and navigate the sources that way just fine.

-1

Please sign in to leave a comment.