Help w/ accessing Java API source code in an easy way . . .

Dear All,

I frequently access the Java API source code. I'd like to know if there is a good way to setup IntelliJ IDEA so that it can quickly and easily view any of the many .java source files from the Java API. And yes, I have a local copy of the entire Java API source code.

I would love to be able to see the "Structure" panel for any Java API source file, etc. Also, using the shortcut to quickly bring up a widget that asks me for what Java class file I want to open (w/ the option of specifying whether or not I want IDEA to look in non-project files), only opens the .class file of Java API classes and not the actual .java file.

Thanks for any help.

2 comments

no_mail@jetbrains.com wrote:

Dear All,

I frequently access the Java API source code. I'd like to know if there is a good way to setup IntelliJ IDEA so that it can quickly and easily view any of the many .java source files from the Java API. And yes, I have a local copy of the entire Java API source code.

I would love to be able to see the "Structure" panel for any Java API source file, etc. Also, using the shortcut to quickly bring up a widget that asks me for what Java class file I want to open (w/ the option of specifying whether or not I want IDEA to look in non-project files), only opens the .class file of Java API classes and not the actual .java file.

Thanks for any help.


You just need to specify where source files are located for any library
you'd like to work with including JDK.

Go to
Settings|Paths|Libraries
and press ellipsis button near JDK you're using. Press Edit button then
and go to the Sourcepath tab. Attach src.zip there with the help of Add
button. Voi la.

--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Hi,.
I usually have my project set up as you describe.
It seems to me I used to be able to ask alt+F7 type questions of the src.zip.
For instance, I used to be able to click on, say, the interface named Shape (java.awt.Shape) which was, say in an import statement and the following would happen
1) I would go to the Shape interface source file (I still do this- no problem)
2) I would see that there were implementations of Shape, (as signified by a blue dot with a down-facing arrow which appeared in the gutter next to the Shape interface declaration )
which I could navigate to.

number 2 has stopped happening for me, and I am not sure why! No blue dot, no indication that there are any implementations of Shape anywhere!

I tried alt+F7 over Shape, only to be told there are no implementations and even adding the unzipped java source to my sources (don't try this at home) resulted in the same behaviour .....

Without asking anyone to trouble shoot my system, IF things are working correctly, how SHOULD I be able to set up my project so that I can achieve 1 and 2 above?


Thank you!

0

Please sign in to leave a comment.