The moose likes IDEs, Version Control and other tools and the fly likes Rt.jar Has No Source Attached In Ecllipse Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply Bookmark "Rt.jar Has No Source Attached In Ecllipse" Watch "Rt.jar Has No Source Attached In Ecllipse" New topic
Author

Rt.jar Has No Source Attached In Ecllipse

sovan chatt
Ranch Hand

Joined: Aug 09, 2010
Posts: 42
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?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 4875

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.
[Thumb - jdksrc.png]
 Filename jdksrc.png [Disk] Download
 Description
 Filesize 60 Kbytes
 Downloaded:  13 time(s)



JBoss In Action
 
 
subject: Rt.jar Has No Source Attached In Ecllipse
 
Threads others viewed
Debugging in Eclipse with Swing Components
Error in Javadocs in Eclipse
Why oh why do I even Try??
Daemon problem
inbuild classes shows only filename.class why ?
developer file tools