views:

163

answers:

5

So far I've just been tacking "java 6" at the end of my class-name search queries in google, but sometimes I'm looking for classes that I don't know the name of, but are designed for what I want to do.

Have any tips or tricks for browsing the JDK docs efficiently?

A: 

What about searches like, say,

vector site:java.sun.com/javase/6

? The site: operator is helpful to restrict your searches to a specific slice of the web.

Alex Martelli
vector site:java.sun.com/javase/6/docs/api/That works very well in google. I made a bookmark of just that site operator searched in google for quick access. Thank you.
Kavon Farvardin
A: 

Try DocJar, it has a javadoc search engine, covering several popular frameworks as well as core java APIs. You can search for text in the body of the javadoc, so you don't need to know the name of the thing you're looking for.

skaffman
Thanks, that was more of something I was looking for, however, it feels clunky.
Kavon Farvardin
+6  A: 

Browse the API documentation directly from your IDE.

For example in IntelliJ IDEA, hitting Ctrl-Q when the cursor is placed on some class or method name (or other code element), shows the API documentation in a popup (something like in the screenshot below). Shift-1 opens the Javadoc in your browser for more comprehensive browsing.

I'm pretty sure there are similar features for Javadoc integration in other IDEs such as Ecplise (hover, F2, or Shift-F2) and Netbeans.

Edit: For "looking for classes that I don't know the name of, but are designed for what I want to do", I'd personally launch the full JDK Javadocs (with frames) in Firefox, start typing something that might be part of the classname, and let "find as you type" help me find it from the left-hand frame with all classes. Works for me quite often. Or you could try GrepDocs.

Jonik
Yes - easy to add source (and hence all the docs) to Eclipse.
Pool
After some snooping in NetBeans I found Ctrl+Shift+Space by default opens this window: http://imgur.com/Pzj2z.png Problem is the external browser button is disabled, I'll have to see what I can do about it (however that isn't a big deal), Thanks.
Kavon Farvardin
That GrepDocs is excellent for C++ too. You've been very helpful, I'd up vote your answer if I could.
Kavon Farvardin
Now you have the rep to do that. ;) Glad to be of help, and welcome to Stack Overflow.
Jonik
Actually it's not that great for C++ after giving it more of a shot. haha
Kavon Farvardin
A: 

I run an instance of Tomcat on my machine, with a simple HTML page that has all the links I need (e.g. Java, Hibernate, Spring, Groovy).

I set this page to be my home page in Firefox. I find this much more useful than bookmarks, which are a wretched way to organize information, IMHO.

I can get to the Java6 doc with "Ctrl-T [or 'Home'], click". After that, navigation is a simple search.

Michael Easter
You could just set the HTML file on disk as your home page. I assume you're running tomcat for other reasons, but if not, it's pretty senseless to run an app server just for a single HTML page.
Chris
(1) I also have links to department resources. The entire team can go to my page as a reference. (2) I also run Groovlets as utilities.
Michael Easter
A: 

I have just unpacked the doco for Java 6 (and 5 and 4) to my local disk and have set up a FF profile with bookmarks to each of the Java versions, plus J2ME, plus my own software library, plus third party doco, plus HTML and CSS, etc. I have set the home page to open up multiple tabs for each of the docs I use regularly, and I just work with this browser open all the time.

So each link is like:

file:///C:/Java/DOC-160/API/Index.html

And, of course, all the doco is fully indexed which is useful when looking for specific classes and methods.

Software Monkey