Sunday, September 4, 2022

Javadoc

 Yay! Another post in the same year!


I've been writing java code since the beginning of Java. The API documentation has been fantastic, it's all in a set of web pages that can be downloaded locally so I can browse it any time I want. Since Java 10 or so, though, the web pages suck. There used to be frames with a tree on the left, which made it easy to click around and find things. The new pages have a search box and no tree, so you have to know what you're looking for, no more discovery. 


Well, today I got tired of using Java 8 javadoc since it's way out of date. I downloaded the Java 18 javadoc. It still sucks for navigation. A google search led me to https://github.com/climber09/Javadoc-Frames-Generator. This works like a charm! It depends on Phantomjs, which is no longer under development, but that doesn't matter because it works well in its current state. So the steps to install:


  1. download and unzip phantomjs somewhere.
  2. download and unzip javadoc-frames-generator somewhere.
  3. in a terminal, cd to the javadoc-frames-generator directory
  4. run /path/to/phantomjs ./jf-generator.js /path/to/javadocs/docs/api
  5. wait for it to finish
  6. open /path/to/javadocs/docs/api/main.html in your browser. Bookmark it for later use. Done!

A big thanks to James P. Hunter for creating this.

No comments: