Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

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.)

share|improve this question

migrated from superuser.com Jun 5 '11 at 11:58

This question came from our site for computer enthusiasts and power users.

1  
I suggest hashmap site:download.oracle.com/javase/6/docs as replacement instead. –  Daniel Beck Jun 5 '11 at 10:01
3  
@Daniel Beck: Seems like an overkill. I want to type less, not more :) –  RonK Jun 5 '11 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=Documen‌​tation&q=%s+url%3A%2Fjavase%2F6%2Fdocs%2Fapi where %s is replaced by the keyword. For example, hashmap. –  slhck Jun 5 '11 at 11:24

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.

share|improve this answer
    
Using this for Java 7, the CSS there is much better. –  Olegs Jeremejevs Aug 1 '12 at 17:56

I have a search keyword with the URL of

http://download.oracle.com/javase/6/docs/api/%s.html

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:

http://duckduckgo.com/?q=java.util.HashMap

share|improve this answer
up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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