Neil Trodden
Neil Trodden

Reputation: 4728

How do I convince Eclipse to show javadoc documentation under Ubuntu 9.04 for openjdk?

I'm having a pretty hard time with this!

I have installed the java documentation at:

file:///usr/share/doc/openjdk-6-jre/api/index.html

And loading that file up does show me all the documentation.

However, I would like to browse it directly from within eclipse and see the documentation when I hover over a class. For example, when I hover over "javax.servlet.http.HttpServletRequest", I would like to see the documentation for it. All I get is:

Note: This element has no attached source and the Javadoc could not be found in the attached Javadoc.

Can anyone help correct my dev environment?

Upvotes: 6

Views: 15087

Answers (4)

Jimmy
Jimmy

Reputation: 39

A slightly different method is needed for Android projects in Eclipse, where you specify the JavaDoc location in "Java Build Path", rather than "JavaDoc Location" settings. See the answer here, which worked for me:

Problems with javadoc

(The JavaDoc problem started happening to me when I deleted my old Android SDK folder.)

Upvotes: 0

Phaedrus
Phaedrus

Reputation: 497

Under Properties, you can enter a URL that hosts the servlet API, such as:

http://tomcat.apache.org/tomcat-5.5-doc/servletapi/

Upvotes: 2

Wasim Hossain
Wasim Hossain

Reputation: 11

The following procedure will enable Java documentation to be available in Eclipse when you hover over some Java class. Download the Java Documentation (this is for version 6) from http://www.google.co.in/url?sa=t&source=web&ct=res&cd=4&ved=0CC0QFjAD&url=https%3A%2F%2Fcds.sun.com%2Fis-bin%2FINTERSHOP.enfinity%2FWFS%2FCDS-CDS_Developer-Site%2Fen_US%2F-%2FUSD%2FViewProductDetail-Start%3FProductRef%3Djdk-6u10-docs-oth-JPR%40CDS-CDS_Developer&ei=T-z3S87CAYuyNq3UweAF&usg=AFQjCNH54wkg50p7PJGmv6dEJd0zxXTGRA&sig2=Pv8-OZ7ZQEAsh89kUFhvUw This is a zipped file jdk-*-docs.zip ( * indicates the version number, for e.g., 6u18 which implies Java Version 6.18). Open Eclipse. Click on Window > Show View > Javadoc Right click on the Javadoc console. Select Open Input. Click "Change Attached Source". Select "External File". Navigate to the directory in which jdk-*-docs.zip exists. Open it. And there you have it - the entire documentation available to you at your fingertip(mousetip?).

Upvotes: 0

C. K. Young
C. K. Young

Reputation: 223043

javax.servlet.http.HttpServletRequest is not part of the OpenJDK, and so the OpenJDK documentation would not contain information on it.

You need to install the Servlet API documentation instead, then, in the library section of your Package Explorer tab, right-click servlet-api.jar, and select Properties. You will then be able to select a javadoc location for that.

Alternatively, for an Ubuntu-friendly solution, install the libservlet2.5-java-doc package, then add the javadoc to your Servlet API jar file using the procedure above.

Upvotes: 8

Related Questions