Java Forum / General / July 2007
how to display java API document in eclipse
wei - 27 Jun 2007 16:51 GMT Hi, I'm new to Eclipse. Is there a way to display java API specification when the mouse is on a standard java class/function? For example, when I hover on the word "System", it should display the spec of java.lang.System like the following page or similar content?
http://java.sun.com/javase/6/docs/api/java/lang/System.html
I specified javadoc location (http://java.sun.com/j2se/1.5.0/docs/ api/) in project properties in eclipse, but when I hover on the word System, a small yellow popup box displays:
"java.lang,System Note: This element neither has attached source nor attached javadoc and hence no information could be found"
Did I do anything wrong?
Any suggestion is appreciated,
Wei
Thomas Fritsch - 28 Jun 2007 14:18 GMT wei schrieb:
> I'm new to Eclipse. Is there a way to display java API specification > when the mouse is on a standard java class/function? For example, when [quoted text clipped - 14 lines] > > Any suggestion is appreciated, What you might have done, is to specify the Javadoc location of your *own* classes written by yourself.
What you have to do, is to specify the Javadoc location of your JRE system library (especially "rt.jar", because this jar file contains the classes java.lang.*, etc). You can do it from the tree view in your package explorer: Right-click on "JRE System Library - rt.jar"; from the pop-up-menu select "Properties"; in the dialog go to "Javadoc location" and enter your location.
 Signature Thomas
Thomas Fritsch - 28 Jun 2007 14:32 GMT Thomas Fritsch schrieb:
> wei schrieb: > [quoted text clipped - 27 lines] > from the pop-up-menu select "Properties"; > in the dialog go to "Javadoc location" and enter your location. and in the same dialog go to "Java source attachment" and enter your local "src.zip" file. (on my system I have "C:/Programme/Java/jdk1.6.0_01/src.zip")
Actually it is the "java source attachment" (not the "javadoc loaction") from where eclipse gets the texts showing up in the yellow pop-ups.
 Signature Thomas
wei - 02 Jul 2007 13:47 GMT On Jun 28, 9:32 am, Thomas Fritsch <i.dont.like.s...@invalid.com> wrote:
> Thomas Fritsch schrieb: > [quoted text clipped - 39 lines] > -- > Thomas Thomas, Thank you for the reply. But this is not what I want. I am trying to display the following page in eclipse, for example, http://java.sun.com/javase/6/docs/api/java/sql/Connection.html (it'll be better if it is displayed in frame) when I click (or by any other action) on the word "Connection" in my code.
Thanks again,
Wei
Ian Wilson - 02 Jul 2007 14:06 GMT > On Jun 28, 9:32 am, Thomas Fritsch <i.dont.like.s...@invalid.com> > wrote: [quoted text clipped - 21 lines] >>>> >>>> Did I do anything wrong? There are two categories of Javadoc as far as Eclipse is concerned: 1) Javadoc you generate for the classes you write yourself. 2) Javadoc for the Sun class libraries
You have applied a solution intended for 1 to the docs for 2.
> I am trying to display the following page in eclipse, for example, > http://java.sun.com/javase/6/docs/api/java/sql/Connection.html (it'll > be better if it is displayed in frame) when I click (or by any other > action) on the word "Connection" in my code. Thomas already pointed out the correct approach. See this tutorial for a more detailed explanation
<http://www.cs.laurentian.ca/badams/c1047/eclipse-tutorials/javadoc-tutorial.html #javadoc2>
wei - 02 Jul 2007 17:00 GMT > > On Jun 28, 9:32 am, Thomas Fritsch <i.dont.like.s...@invalid.com> > > wrote: [quoted text clipped - 37 lines] > > <http://www.cs.laurentian.ca/badams/c1047/eclipse-tutorials/javadoc-tu...> Hi Ian,
Thank you for the info. I got it working now. The only step I missed before was to press shift-F2.
By the way, do you know how to get Firefox to work with Eclipse and recognize the space in "file:/c:/Program Files/..."?
Firefox only reads "file:/c:/Program", and I tried to put quotes around the location string in eclipse, it doesn't work.
Thanks again,
Wei
Thomas Fritsch - 02 Jul 2007 17:30 GMT wei schrieb:
> By the way, do you know how to get Firefox to work with Eclipse and > recognize the space in "file:/c:/Program Files/..."? > > Firefox only reads "file:/c:/Program", and I tried to put quotes > around the location string in eclipse, it doesn't work. Try "file:/c:/Program%20Files/..."
 Signature Thomas
Ian Wilson - 02 Jul 2007 17:44 GMT > wei schrieb: > [quoted text clipped - 5 lines] > > Try "file:/c:/Program%20Files/..." Interestingly, it works for me without encoding the space
I have WinXP Pro SP2 Firefox 2.0.0.4, Eclipse 3.2.2 (the Web Services version),
In Eclipse my rt.jar "Javadoc location" has (*) Javadoc URL Javadoc location path: file:/C:/Program Files/Java/jdk1.6.0_01/docs/api/
I think I used the "Browse" button rather than type it in by hand.
When I press shift-f2 Firefox shows the URL as (e.g.) file:///C:/Program%20Files/Java/jdk1.6.0_01/docs/api/javax/xml/validation/Validator.html
wei - 02 Jul 2007 19:32 GMT > > wei schrieb: > [quoted text clipped - 22 lines] > When I press shift-f2 Firefox shows the URL as (e.g.) > file:///C:/Program%20Files/Java/jdk1.6.0_01/docs/api/javax/xml/validation/Validator.html Ian,
I have the same versions of software as you do, and tried both approaches before I post my last message, none of them works with my local javadoc file 1. use %20 with/without quotes, eclipse shows "Location does not exist" 2. use browse button, eclipse is ok, but firefox showed the error 3. use web docs in sun site, works. I'd try to get away from it, since it needs internet connection.
Thanks,
Wei
Ian Wilson - 03 Jul 2007 17:55 GMT >>>wei schrieb: >> [quoted text clipped - 37 lines] > > Wei I suspect the problem is in the way Eclipse launches Firefox which is probably using WinXP file associations to launch your default browser.
Windows on this PC launches 'Firefox URL's using DDE "%1",,0,0,,,, Maybe your registry entry lacks the quotes around %1?
I used Windows Explorer, Folder Options, File Types to find this.
Perhaps our history of updating Firefox/Mozilla differs and this lead to a glitch on your PC?
wei - 03 Jul 2007 18:41 GMT > >>>wei schrieb: > [quoted text clipped - 48 lines] > Perhaps our history of updating Firefox/Mozilla differs and this lead to > a glitch on your PC? Ian, I checked the settings on my pc, and it's the same as yours. DDE "%1",,0,0,,,, with quotes around %1
and the application used to open html files is C:\PROGRA~1\MOZILL~1\FIREFOX.EXE -url "%1" -requestPending
Do you think it's a setting issue in Eclipse?
Thanks,
Wei
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|