I am using eclipse indigo to run my java files.The codes run properly but when I try to see the class hierarchy I get the error "Rt.jar Has No Source Attached" .So,I googled and did the following:I tried to go in Windows and preferences and set the jdk path..even then it would not work.What to do now?
Most likely you are using a JRE and not a JDK to run Eclipse, and most likely you are using that same JRE for your project. One way to fix this is to add a JDK to the list of JREs (Window | Preferences | Java | Installed JREs) and then use that for your project. Anoither way is to attach a src.zip file from a corresponding JDK to your JRE. In that same preferences dialog, edit the default JRE, and in the JRE System Libraries list, expand the rt.jar file entry, click the Source Attachment subentry and then click the Source Attachment button. Then browse to the src.zip file in the JDK that has the same version number as your JRE.
Of course, all of this assumes that you installed a JDK on your system.