Java 8 JRE javadoc for offline

How can I install JRE 8 javadocs for offline use in Intellij? I tried the obvious solution of downloading the docs from here

   http://www.oracle.com/technetwork/java/javase/documentation/jdk8-doc-downloads-2133158.html

and then point IntelliJ to the zip file under the "Documentation Paths" tab of the SDKs settings. No dice.

Since I have offline for most other libraries (downloaded autmatically through maven), I figure I should be able to get the offline docs for the JRE too somehow. Note that I can use the onlinedocs by entering the URL in the "Documentation Paths" tab. But I would prefer to have the docs for offline use so I can at get it any time,

-JM

8 comments
Comment actions Permalink

Unpack the zip somewhere and specify the path to docs/api subdirectory:

http://i.imgur.com/PthJnKR.png

1
Comment actions Permalink

Thanks! That worked fine. I was under the impression that you could link directly to the ZIP file, just as you can do into a javadoc JAR file, but that's apparently not the case. After all, a JAR is just a ZIP with another name, so it would seem it should work. Perhaps that's something for you to enhance in the future.

-JM

0
Comment actions Permalink

Quck JavaDoc works from sources already available with JDK (if installed).

HTML documentation is used for External Documentation feature which opens in external browser. Most browsers can't browse pages from inside archives.

0
Comment actions Permalink

Yes, I know that. Yet you can open javadoc from within JAR files, presumably using some internal web server in Intellij, since the URL in my browser when reading javadoc form within a JAR file begins with

   http://localhost:63342

So it seems ntellij serves this using a built-in web server on port 63342 which reads form within the JAR file itself. Likewise, it should be able to read docs from within the ZIP file, since a JAR and AIP in this regard is pretty much the same thing. Right?

-JM

0
Comment actions Permalink

Did you try to specify doc/api path inside the .zip?

http://i.imgur.com/cfaifW7.png

0
Comment actions Permalink

Wow. I didn't know you could do that. Alas, it doesn't actually work for accessing the docs. The External Documentation command is available, but doesn't do anything. Would you consider that a bug or something that could be improved? I would expect this could be made to work, since it's really not that different from serving javadoc from within a JAR file. Unpacking the ZIP and pointing to the api folder does work though, so yo helped me solve my problem. Many thanks again.

-JM

0
Comment actions Permalink

I wanted to access, look up and/or select the elements, which are a part of the Oracle's JavaSE 8 documentation Website, within the code-completion tools and Quick Documentation functions of the IntelliJ- without having to access them through Chrome. I really don't like the way, the access and search functions - or the lack there of, work at "https://docs.oracle.com/javase/8/docs/api/"


Defining the $PATH for API/DOC does not work for the above intents and purposes. IntelliJ needs to find the JAR files as well as the $PATH. I tried selecting each of the JAR files under the SDK Documents. It didn't work because the compressed JAR and ZIP files are HTML5/EcmaScript5 format Java Scripts. In addition, my default HTML was set to EcmaScript 6. This can cause problems since Ecma6 have brought in Significant changes to Ecma5. Consequently, Oracle's archaic web scripts work the best with Ecma5. 


Here is what I have done;
Set default to HTML5 and XML 1.0 
Go to JavaScript Library settings. Click + to add a new library.
Give a name to your library. Set the visibility to Global. Select JSQuaryUI from the framework type. You should do this before selecting your files.
Click on +  and select attach files option.
Goto your Jdk1.8.0_121 folder.
Start opening every folder and sub-folder. It will most likely display the script.js and .c files. Painstakingly go thorugh and select these files all the way through the JDK folder.
I have 20 script.js files and 3 .c files selected.
I also included Doc folder path in the selection menu. In addition describe the local URL path to Jdk1.8.0_121 folder. (http:///c:/program%20files/java/....)
There might be better alternative ways than the ones I listed here. However, this does the job for my needs. 
Also make sure NodeJs, lint, typescript etc are set. 


Outcome:
While typing the code, more suggestions are displayed within the code completion pop-up tool. Basically, if you want to learn about an element listed in the code completion tool box, you can just hover your mouse over it. Quick Document window will open up on the right. If you click on the up arrow in the Quick Documents window pane, Java script will create a pdf document, regarding to the looked up element including Methods, Classes and etc... 
This way, I can search only for the elements which are relative to my code and display information only for the element I looked up. If I search for multiple elements, each them are displayed in a seperate PDF document. This allows me to go back and forth between the documents with ease. I actually set the Acrobat to open the pdf documents in split screens so that I can compare one element to another side by side. In addition, I get to save the PDF files relative to my searches.

0

Please sign in to leave a comment.