21

I have JDK 7 and eclipse JUNO installed on my windows 7 system .Both of them are working fine and eclipse is very well compiling my Java apps and running them as well .

But when I roll-over my cursor on syntax,then it is not showing its description.It says :

This element has no attached source and the Javadoc could not be found in the attached Javadoc.

for every element. I could not find anything useful on the google and also there is no similar post on StackOverflow.

What is the problem?

Naveen
  • 7,944
  • 12
  • 78
  • 165
  • Have you given it a URL from which it can load javadocs? – duffymo Jan 07 '13 at 15:15
  • 3
    This has to have been answered previously on the interwebs - what have your searches shown you? – KevinDTimm Jan 07 '13 at 15:15
  • @duffymo :I have reinstalled my windows today ,but I never gave such a URL to eclipse when i previously installed it and it still was working fine. – Naveen Jan 07 '13 at 15:19
  • IMO you don't need to give it an URL, just use a JDK and not a simple JRE library... – brimborium Jan 07 '13 at 15:21
  • You reinstalled Windows? Hopefully not because of this problem. A simple Google search would give you the answer: http://stackoverflow.com/questions/9870448/how-to-attach-source-or-javadoc-in-eclipse-for-any-jar-file-e-g-javafx – duffymo Jan 07 '13 at 15:30
  • @duffymo You don't want to know how many people solve their abitrary computer problems by reinstalling Windows... ;) – brimborium Jan 07 '13 at 15:34
  • @duffymo :I didn't reinstalled windows to solve this problem ,but it crashed and that's why i had to reinstall windows and eclipse as well,and the problem arose. – Naveen Jan 07 '13 at 15:40
  • 2
    @brimborium - I go a step further. When my machine crashes I set it on fire and get a new one. I don't like taking chances. – duffymo Jan 07 '13 at 15:47
  • 1
    What would the procedure be to get the "closed as not a real question" flag removed from this question? Because I think it is a valid question that can clear up the difference between JDK and JRE for many users (the view count suggests that the question comes up often). – brimborium Jul 01 '14 at 07:28

1 Answers1

44

Are you sure your eclipse works with a JDK and not a JRE? Go look in Project>Properties>Java Build Path in the tab libraries and see if you have linked a JDK or JRE.

For instance here, a JDK is used:

enter image description here

If you only have JRE's installed, you need to install a JDK first (find it here), then in Eclipse go to Windows>Preferences>Java>Installed JREs and add your JDK there. Then you can add it as a library in your project settings (in the screenshot above)...

brimborium
  • 9,362
  • 9
  • 48
  • 76
  • :Yes ,i said that applications are running well from eclipse. There is only `JRE System Library`. – Naveen Jan 07 '13 at 15:24
  • Well they also run well if you have linked a JRE, but the Javadocs will not show up in that case IMO... – brimborium Jan 07 '13 at 15:26
  • :How can I link the JDK,then ? – Naveen Jan 07 '13 at 15:28
  • You need to install a JDK first (find it [here](http://www.oracle.com/technetwork/java/javase/downloads/index.html)), then in Eclipse go to `Windows>Preferences>Java>Installed JREs` and add your JDK there. Then you can add it as a library in your project settings (in the screenshot above)... – brimborium Jan 07 '13 at 15:32
  • 2
    :Thanx a lot , the JDk was already installed but eclipse was using the default jre.,not the JDK. – Naveen Jan 07 '13 at 15:36
  • It tends to do that, yes... ;) Glad I could help. – brimborium Jan 07 '13 at 15:37
  • I don't get why using a JDK solves the problem, but it solves it. Thank you. – Abel Morelos May 12 '14 at 05:22
  • 1
    @AbelMorelos The normal **JRE** contains the Java Runtime with focus on being as fast, efficient and as small as possible, so standard users can conveniently download and use it to run Java programs. The **JDK** (Java Developer Kit) is directed towards the developer. It still got everything the JRE got, but has additionally the Javadoc (and several other things) included. Hope that answers your question. ;) – brimborium May 13 '14 at 08:09