The steps i used to get the JLS into my kindle with the pretty good result:
1) Download JLS in the HTML format with the help of some site downloader.
I used HTTrack (settings: initial url is http://docs.oracle.com/javase/specs/jls/se7/html/index.html, default "preferences and mirror options" except for "build"/"local structure type", which i set to "html in web/, images/others in web/").
The result should be something like a directory with 25 html files, 1 css and 1 image file, and the links inside the html files should be properly relativized.
2) Edit the css file to remove some formatting that will not look good on Kindle (absolute layouts, excessive left and right margins). I simply commented out "div.chapter div.toc", "div.chapter", "ol li" and "ul li" sections and left everything else as is.
3) Use Calibre to convert this set of files into mobi.
The resulting mobi flows nicely and so far all internal links work as expected.