Win a copy of The Java Performance Companion this week in the Performance forum!
    Bookmark Topic Watch Topic
  • New Topic

Rt.jar Has No Source Attached In Ecllipse

 
sovan chatt
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
jdksrc.png
[Thumbnail for jdksrc.png]
 
manto kumar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Report post to moderator
How to do the same on eclipse running in linux?
Even after pointing it to the src.zip, the source isnt visible i think because .zip maynot be recognized in linux.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Manto, please don't ask the same question in multiple posts. Let's continue in your other post:
http://www.coderanch.com/t/613063/vc/attach-Source-rt-jar-linux#2801825
 
    Bookmark Topic Watch Topic
  • New Topic