4

I'm new to Eclipse and am using it currently to play with Java EE.

When using Ctrl+Space for types/functions from the regular Java libraries I get a full description (i.e. general description of the type, what are the arguments of the method for, etc.). However I don't get the same for Java EE types.

For example, when using Ctrl+Space on methods of the HttpSession class I get only names like "arg0" or "obj" and no description.

How can I remedy this?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
maayank
  • 4,200
  • 2
  • 24
  • 23

3 Answers3

4

I'd suggest downloading the javadocs and adding them in eclipse. (right click project > properties > java build path > libraries > expand the library > set Javadoc location)

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
  • @Pascal Thivent - yours is better, it has green :) – Bozho Apr 01 '10 at 08:48
  • 1
    I've done this with the sources mentioned by Oliver and it works (tnx!). Is there a way to do it in the general eclipse properties so the documentation/sources will be available for all projects, without me needing to fix each project by hand? – maayank Apr 01 '10 at 09:20
  • the answer is too related to a single library. The user (and I) need to enable documentation/hints for all Java EE libraries avaible at http://docs.oracle.com/javaee/7/api/ – Germano Massullo Nov 13 '13 at 11:37
3

I think that's why Java EE defines a specification only, the implementation must then be done by the provider of your application server. javax.servlet.http.HttpSession e.g. is bundled in servlet.jar.

It you are using Tomcat as your application server, you could attach the java sources to your servlet.jar and then you can browse the source and read it's javadoc.

The source for the latest tomcat is here -> http://www.apache.org/dist/tomcat/tomcat-6/v6.0.26/src/apache-tomcat-6.0.26-src.zip

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Oliver Michels
  • 2,837
  • 1
  • 19
  • 14
1

I wanted to add what might be very pertinent information for projects using maven and eclipse / wtp. What I did to get the Javadocs to attach nicely was the following 2 steps.

1) I am using glassfish so using the glassfish plugin site I installed the java ee 6 (or 7) documentation. You can easily view this documentation with Help->Java EE 6 docs. I copied the URL from here.

2) Opened my projects build path and went to the libraries tab. Opened the Maven Dependencies and found the java ee 6 api entry (this should be part of the maven project). Opened this up and was able to add a location for the javadocs for the api. I pasted the file:/// url I had copied.

Then I verified this worked by using the ctrl + shift plus mouse pointer hover over some of the java ee 6 classes and methods.

I hope this information will be useful to other who searched and got here but didn't find the solution they were looking for (or for those who now use Maven!).

geocode
  • 51
  • 3