/ GEARS, GREASEMONKEY, JAVADOC, OFFLINE

Easy offline Javadoc

If like me you’re traveling often, and develop while doing so, you don’t want to waste time. Every laptop nowadays has a wifi interface: problem is finding the hotspot, not an easy task on a plane or on a train.

Once, I used to download and save each and every Javadoc of Java, JEE and the various OpenSource frameworks I used (Struts, Hibernate, Spring, you get the idea). As bad luck would have it, 9 times out of 10, I hadn’t the correct version when I needed it. That was both frustrating and time-consuming.

Then, tonight, I found the product that make browsing Javadoc offline a transparent process, provided:

  • you browsed them previously online,
  • you use Mozilla Firefox as your browser.

Setting up this marvelous product is a multi-part process. The caching of the Javadoc is done through Google Gears. Gears is a Firefox extension that enables storing data in a local database. In order to install Gears, go to the Gears website and download it. Then follow instructions.

Now you have to setup the client script engine. Greasemonkey allows to customize the rendered web pages on a client’s browser. Browse to the Greasemonkey homepage with Firefox and install the extension.

Last but not least, you should install the script that does the real job. It was developped by James Dumay and is real time-saving. In order to set it up, you only have to browse the following URL, provided you have Greasemonkey installed.

Now, each and every time you browse a new Javadoc, you’ll see a window asking you to authorize Gears to cache the Javadoc locally.

Authorization window for Gears

FYI, once you allow a site, other APIs of the same site are cached automatically without need to authorize again. Once cached, you’ll have the privilege to browse the Javadoc offline. Isn’t life sweet?

Nicolas Fränkel

Nicolas Fränkel

Developer Advocate with 15+ years experience consulting for many different customers, in a wide range of contexts (such as telecoms, banking, insurances, large retail and public sector). Usually working on Java/Java EE and Spring technologies, but with focused interests like Rich Internet Applications, Testing, CI/CD and DevOps. Also double as a trainer and triples as a book author.

Read More
Easy offline Javadoc
Share this