File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue with JavaDoc, Code Assist and Eclipse

 
Ralf Rottmann
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I have an issue with Eclipse's build in Code Assist and Java API Doc feature. I tried to use Google and the Eclipse mailing list before, but without any result as towards a solution of the problem. I assume it might be a very small configuration thing and therefore I hope somebody from JavaRanch might be able to help.
As it tends to be difficult to refer to all the Eclipse settings by words, I have assembled a quick description of the problem along with a set of screenshots at http://www.rottmann.net/java .
Your help is greatly appreciated.
Ralf
 
Ed Burnette
Author
Ranch Hand
Posts: 142
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Code assist and hover help don't work off the javadoc. They work directly off the source code. So to get them to work you need to associate source code (usually a jar or zip file containing the source code) with each jar file. For standard Java libraries there is a shortcut - define your JRE in Eclipse preferences to point to the SDK directory (for example c:\j2sdk1.4.2_02) instead of the JRE location (for example c:\Program Files\Java\j2r31.4.2_02) and Eclipse will figure out the rest.
 
Ralf Rottmann
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ed, thanks a lot for helping!
I changed general Eclipse preferences the way you described it in your reply. And the problem has partially been solved. When I now hover over, e.g.:
System.out.println
I do get the full signature AND description displayed in the little popup. I guess Eclipse drives it from the src.zip file in C:\j2sdk1.4.2_02 .
However, if I hover over any method of any HttpSession object (I assume in general over any from any javax package) I only get the method signature, not the full description.
And still, if I press Shift-F2 I receive the error message that I have to set a location anywhere. But I don't know where?
Any idea?
 
Ralf Rottmann
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Update:
I just found out that I did not have ALL JavaDocs available, only the ones coming with J2SE. I added the J2EE JavaDocs from sun.com and now the Shift-F2 over e.g. HttpSession is working fine.
I also found where to configure the documentation path for e.g. the javax.servlet.jar file.
Question 1: Is there any way to configure this location globally, or do I have to set it new for each single project I am creating?
Question 2: While JavaDocs (Shift-F2) seems to work perfectly well, now, I still have problems with Code Assist and the hover popup. It only displays info on some of the packages. I assume that the src.zip file does not contain the required information for packages like javax.servlet.jar. If so, where do I get the "rest of the src.-files"?
Best regards
Ralf
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ralf Rottmann:
I also found where to configure the documentation path for e.g. the javax.servlet.jar file.
Question 1: Is there any way to configure this location globally, or do I have to set it new for each single project I am creating?

If you configure this in the Build Path settings of one project, it should be available to all projects, if I am not mistaken.

Question 2: While JavaDocs (Shift-F2) seems to work perfectly well, now, I still have problems with Code Assist and the hover popup. It only displays info on some of the packages. I assume that the src.zip file does not contain the required information for packages like javax.servlet.jar. If so, where do I get the "rest of the src.-files"?

Most probably from wherever you got the binary jar files. For servlets, it should be downloadable somewhere at sun.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic