How to import com.sun.javadoc.* in eclipse?

ぃ、小莉子 提交于 2019-12-18 15:48:16

问题


Importing com.sun.javadoc eclipse report me this error "The import com.sun.javadoc cannot be roselved" it seems the package is not installed. Looking at the web sitehttp://download.oracle.com/javase/1.5.0/docs/guide/javadoc/doclet/spec/index.html?com/sun/javadoc/package-summary.html only the API are displayed but I cannot download anything. How can I do


回答1:


What I usually do is, in Eclipse preferences, I define an Installed JRE called "JDK X.Y.Z" and include tools.jar as part of it libraries. Then I change the project preferences to use that JRE "JDK X.Y.Z".

The other approach is to simply add tools.jar to your project's library or point to it in the project path.




回答2:


You need to add Tools.jar from the JDK install into your project's build path.

Right click your project in the Package Explorer, and go to properties. On the left, click "Java Build Path". Go to the "Libraries" tab and click "Add External JARs". Navigate to your JDK install and go to the LIB folder. Select tools.jar, and hit okay.




回答3:


http://java.sun.com/j2se/javadoc/faq/index.html#com.sun.javadoc

The JDK's tools.jar is not typically included in Eclipse project class paths. You should avoid using com.sun.* code if you can.




回答4:


Do you actually have a JDK installed, or maybe just an JRE?

Also see Depending on com.sun.javadoc from tools.jar (Sun JDK) in Eclipse.



来源:https://stackoverflow.com/questions/4797079/how-to-import-com-sun-javadoc-in-eclipse

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!