I use Google a lot to look for Java documentation.

Example: If I want to find documentation for HashMap, I just google Java hashmap and Google knows to redirect me to the javadoc page.

However, it usually directs me to Java 1.4 or Java5 documentation, and I want Java6 documentation.

If I google Java 6 hashmap, it works fine; the problem is I keep forgetting to put 6 and have to search twice.

Can I teach Google somehow that when I say Java, I mean Java6? (I have a Google account, so if it is somehow configurable via an account, I'm open for suggestions.)

  • 1
    I suggest hashmap site:download.oracle.com/javase/6/docs as replacement instead.
    – Daniel Beck
    Jun 5, 2011 at 10:01
  • 3
    @Daniel Beck: Seems like an overkill. I want to type less, not more :)
    – RonK
    Jun 5, 2011 at 10:11
  • 2
    You could just create a keyword search in your browser: http://search.oracle.com/search/search?search_p_main_operator=all&group=Documentation&q=%s+url%3A%2Fjavase%2F6%2Fdocs%2Fapi where %s is replaced by the keyword. For example, hashmap.
    – slhck
    Jun 5, 2011 at 11:24
  • You think you have it bad ... Feb 27, 2017 at 1:45

3 Answers 3


I had the same problem/wish. This is what I did to solve it:

  • Install this Greasemonkey script (which is a bit out of date, since it was made before Oracle bought Sun)
  • Edit the script slightly to make it work with Oracle's website. This is the edited script:

    // ==UserScript==
    // @name           Java 6 Documentation Redirect
    // @namespace      http://freecog.net/2007/
    // @description    Redirects to the Java SE 6 documenation from older pages.
    // @include        http://download.oracle.com/javase/*
    // ==/UserScript==
    var old_loc = loc = window.location.href;
    loc = loc.replace(/\/javase\/[^\/]+\/docs\//, "/javase/6/docs/");
    if (loc != old_loc) window.location.replace(loc);

The only changes are to the @include URL and the regex.

That way, whenever you open a Java documentation page, it redirects to the Java 6 version. If you ever really need to see an older version, you can temporarily disable the user script.

  • Using this for Java 7, the CSS there is much better.
    – Alec Mev
    Aug 1, 2012 at 17:56

I have a search keyword with the URL of


Then I just have to type in the name of the class replacing . with /. I type this into my browser:

j java/util/HashMap

You can also use Duck Duck Go — it will onebox Java classes, and it appears to consistently choose Java 6:



Thank you for all the answers - I eventually solved it by creating my own custom search engine in Chrome (partial solution to the problem I posted - but a full solution for my personal problem).

The search engine is defined as: https://www.google.com/search?q=java%206%20%s
And I assigned it the keyword java - that way all I need to type in the address bar is java hashmap and I get the result I wanted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.