像Microsoft Visual Studio 一樣,使用Eclipse編寫java代碼時,將鼠標放在相應方法或字段等元素上時,會有對應的說明或提示。
不過,常出現下面的問題:
Note:An exception occurred while getting the javadoc.see log for details.
Note:This element neither has attached source nor attached Javadoc and hence no information could be found.
Note:This element has no attached source and the javadoc could not be found in the attached javadoc
點擊javadoc下的open input:
class editor提示找不到對應的rt.jar文件。
you can attach the source by clicking attach source below
那么,點擊“attach source”,加載相應文件即可:
選擇External file:
如果你安裝jdk的話,附加文件的路徑是:
C:\Program Files\Java\jdk1.6.0_12\src.zip
OK!一切正常了:
祝好運……