Javadoc location for eclipse offline

Help for Java in Eclipse (normal Java development, not Android development) is installed on the Oracle server online URL associated with http://docs.oracle.com/javase/6/docs/api/ . However, with one specific computer, I cannot be online during the Java class I teach. So I want to use local help.

I tried the following:

  • Open windows - preferences - java - installed jre
  • select runtime 1.7, and there rt.jar
  • Click Javadoc Location.

There I see a link to online help. Instead, I tried using the original archive, the src.zip folder in the JDK directory. But that does not work. In either case, the source does not contain a compiled Java document.

Do I need to download API documents? And if, where?

+8
source share
6 answers

Of course, I already installed the JDK with the source. On the machine, I found JRE7 and JDK1.7xxx, and projects use JRE7.

  1. In Window - Preferences - Java - Installed JRE I found a link to JRE7, which does not contain sources or Javadoc.

  2. So I clicked "Edit" and looked at the directory until JDK1.7, then clicked "Restore to default." This will change the JRE system libraries to the JDK. The location of the Javadoc for rt.jar and other jar files is now in Oracle, but nonetheless, the installed src.zip is used if there is no Internet connection.

Furthermore, it is really possible to attach the src.zip file (file!) To rt.jar JRE7.

+6
source

EASY SOLUTION: Here is a video tutorial on this issue: link

+4
source

I ran into this problem. This is because I used the JRE, not the JDK JRE.

First update the default JRE:

  • Go to Window> Preferences> Java> Installed JREs
  • Make sure your JDK JRE is used. If not, add it:
    • Add> Standard Virtual Machine> Point "JRE Home" to <JDK directory, not./bin> >> OK
    • Go to Window> Preferences> Java> Installed JREs> Runtime.
    • Ensure that the JDK JRE you added is the default JRE for your chosen Java environment.

Then update your existing project to use this JRE:

  • Go to Project> Properties> Java Build Path> Libraries
  • Scroll down to where you see the JRE System Library
  • Click it, then the "Edit" button.
  • Change the selection (either the runtime or the alternative JRE) so that it points to your JDK JRE.
  • Click Finish

You must have JavaDocs for the JRE library now! πŸ˜Šβ˜•

If not, you may need to update your JavaDoc settings by choosing Window> Preferences> Java> Compiler> Javadoc and uncheck "/ apply / double-check / apply" " Process Javadoc comments to Process Javadoc comments .

+1
source

If I remember correctly, you do not need API documents at all if you have src.zip available and configured. Eclipse should pick up Javadoc from sources, as your own code does.

Edit: how to configure src.zip :

  • Open the "Installed JRE" settings panel
  • Click "Change ..." for your JRE
  • For each library you want, click "Original src.zip ..." and select the src.zip file.
0
source

There are different options (as @siegi and @Thorbjorn_Ravn_Andersen said), and it depends on what you want to do:

  • If you just want to read the JavaDoc of one of the API methods that you use, then it should be enough to read the source code (as mentioned in @siegi) or open the JavaDoc view and read a more polished version of it from there.
  • You can view the downloaded JavaDoc API mentioned by @Thorbjorn.

However, in the class I would like to say that people use their IDE all the time, so I think browsing the source on the Internet is much more natural (for a Java developer), and you are sure to see the documentation that was written in sources you use.

If you want to get an overview of packages or classes, it may be more convenient to use the API in the browser.

0
source

Source: https://habr.com/ru/post/913836/


All Articles