• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

eclipse and javadoc

 
Gabor Beres
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sir!

i'd like to install javadoc under eclipse, in order to show some help in the editor.
how can i do that?

thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34870
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gabor,
Eclipse 2.1 and later provide an option to run javadoc. Eclipse 3.0 provides a view to display it in the editor. Is this what you are looking for?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Javadoc for what? For the JDK classes? Thirdparty libraries?
 
Gabor Beres
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne

I'd like to view it in the editor(for methods, class etc...)
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eclipse automatically shows the JavaDoc in the editor if it knows the source code for the class. How you tell it where to find the source depends on your answer to my first question...
 
Gabor Beres
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne
I doen't mean the souce code viewing featue. i already know that.
I dowloaded the entire javadoc for java2 SE 5.0, and just want to make use of it under eclipse.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand. You don't need the Javadoc, you only need to point Eclipse to the src.zip of the JDK. Eclipse will then extract the Javadoc information and show it whenever you hover the mouse of a reference to a class, method, whatever from the JDK.
 
Gabor Beres
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"you only need to point Eclipse to the src.zip of the JDK"

that's exactly what i'd like to do. just don't know how
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34870
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gabor,
In Windows->Preferences->Java->JRE, you can change the JRE/JDK. Note that this will change the compiler too. While the Eclipse 3.0 doesn't support Java 5 features (unless you download the beta version that has that support), you can still use the Java 5 compiler and JavaDoc.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gabor Beres:
"you only need to point Eclipse to the src.zip of the JDK"

that's exactly what i'd like to do. just don't know how


Exactly as Jeanne already posted.

We could have told you much earlier if you just had answered my very first questions - namely that you want the javadoc for the JDK classes. :roll:
[ January 24, 2005: Message edited by: Ilja Preuss ]
 
Owen Densmore
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so I'll be the dummy: can you enter the src.zip file in the preferences>java>installed JREs Javadoc URL entry for the default JRE? I thought you had to enter a javadoc jar/folder for that. Is Eclipse smart enough to figure out its a source tree and not only extract the javadoc info but also the source information too?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Owen Densmore:
OK, so I'll be the dummy: can you enter the src.zip file in the preferences>java>installed JREs Javadoc URL entry for the default JRE? I thought you had to enter a javadoc jar/folder for that. Is Eclipse smart enough to figure out its a source tree and not only extract the javadoc info but also the source information too?


OK, I guess I deserve that for not trying out my own suggestions...

No, you don't enter the zip file as the Javadoc URL. The Javadoc URL isn't used for in-editor javadoc.

All you need to do is point Eclipse at the "JRE home directory" of a fully fledged JDK (in contrast to a real JRE), it will then automatically pick up the src.zip file.

To see wether it did that correctly, take a look at "Java/Build Path/Classpath Variables" - there should be a JRE_SRC variable containing the path to the tip file.

Sorry for the confusion...
 
Owen Densmore
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that makes things clearer.

BTW: My desire to lob in a source dir/jar/zip is that I use Mac which nicely downloads the latest JRE when its available. So I'd like to either add the src.zip directly to the JRE's directory or bind it to the JRE within eclipse via some preferences magic. Doesn't look possible. Hmm..maybe if I just put the zip in the jre directory and reboot???

Owen
 
Owen Densmore
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeehaa! It worked:

I downloade a java.sun.com 1.4.2 linux distro, grabbed the src.zip file from it, copied it to the mac location (/Library/Java/Home) for javahome, exited and restarted eclipse, and it worked: tooltips show lots more interesting information.

Love it when something goes right!

Owen
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34870
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Owen,
Glad to hear it's working. Thanks for posting what you did for people who read this thread in the future.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic