Eclipse can't find Java source code [message #696715] |
Thu, 14 July 2011 17:22  |
Eclipse User |
|
|
|
Hi,
I have just started using Eclipse, having previously used NetBeans.
I would like to be able to CTRL + Click on a standard Java function in my code and have its source code displayed, as I believe is intended. However, if I try and do so, I get a screen with the following message:
Quote:Class File Editor
Source not found
The JAR file C:\Program Files\Java\jre6\lib\rt.jar has no source attachment.
You can attach the source by clicking Attach Source below:
But regardless of which folder I choose I can't seem to get it to recognise the Java source code in the way that NetBeans did.
I have the following file:
C:\Program Files\Java\jdk1.6.0_21\src.zip
Can anyone advise me on what to do?
Thanks,
- Dan
[Updated on: Thu, 14 July 2011 17:23] by Moderator Report message to a moderator
|
|
|
Re: Eclipse can't find Java source code [message #696789 is a reply to message #696715] |
Thu, 14 July 2011 20:23   |
Eclipse User |
|
|
|
The recomended way would by to switch from using a jre to using the jdk inside of Eclipse. Go to Windows->Preferences->Java->Installed JREs. Select Browse and navigate to the C:\Program Files\Java\jdk1.6.0_21 directory. Eclipse will automatically find the source and associate it with the JDK classes.
If you still want to use the jre, go to Windows->Preferences->Java-Installed JREs. Select the jre you are using. Click Edit. In the resulting dialog select all the jar files. Click Source Attachment button. Navigate to the src.zip file you referenced in you message and select it.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03364 seconds