aspose file tools*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply locked New topic
Author

Rt.jar Has No Source Attached In Ecllipse

sovan chatt
Ranch Hand

Joined: Aug 09, 2010
Posts: 43
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: 5779
    
    7

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.


[Thumbnail for jdksrc.png]



JBoss In Action
manto kumar
Greenhorn

Joined: Jan 10, 2012
Posts: 10
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

Joined: May 14, 2008
Posts: 5779
    
    7

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Rt.jar Has No Source Attached In Ecllipse
 
Similar Threads
inbuild classes shows only filename.class why ?
Why oh why do I even Try??
Debugging in Eclipse with Swing Components
Error in Javadocs in Eclipse
Daemon problem