wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes eclipse and javadoc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "eclipse and javadoc" Watch "eclipse and javadoc" New topic
Author

eclipse and javadoc

Gabor Beres
Greenhorn

Joined: Dec 21, 2004
Posts: 21
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30146
    
150

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?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Javadoc for what? For the JDK classes? Thirdparty libraries?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Gabor Beres
Greenhorn

Joined: Dec 21, 2004
Posts: 21
Jeanne

I'd like to view it in the editor(for methods, class etc...)
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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

Joined: Dec 21, 2004
Posts: 21
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

Joined: Jul 11, 2001
Posts: 14112
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

Joined: Dec 21, 2004
Posts: 21
"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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30146
    
150

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

Joined: Jul 11, 2001
Posts: 14112
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

Joined: Aug 29, 2004
Posts: 4
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

Joined: Jul 11, 2001
Posts: 14112
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

Joined: Aug 29, 2004
Posts: 4
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

Joined: Aug 29, 2004
Posts: 4
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30146
    
150

Owen,
Glad to hear it's working. Thanks for posting what you did for people who read this thread in the future.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: eclipse and javadoc
 
Similar Threads
eclipse Javadoc autocomplete broken?
needed pluggin for java api in ecllipse
Javadoc with Eclipse Helios
Can I use Eclipse to generate javadoc?
ClassNotLoadedException in Eclipse debugger