java 如何在eclipse中导入com.sun.javadoc.*?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4797079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to import com.sun.javadoc.* in eclipse?
提问by Pool
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.htmlonly the API are displayed but I cannot download anything. How can I do
导入 com.sun.javadoc eclipse 向我报告此错误“导入的 com.sun.javadoc 无法被解决”,看来该软件包未安装。查看网站http://download.oracle.com/javase/1.5.0/docs/guide/javadoc/doclet/spec/index.html?com/sun/javadoc/package-summary.html只有 API 是显示,但我无法下载任何东西。我能怎么做
回答by Bert F
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".
我通常做的是,在 Eclipse 首选项中,我定义了一个名为“JDK XYZ”的已安装 JRE tools.jar
,并将其作为库的一部分包含在内。然后我更改项目首选项以使用该 JRE“JDK XYZ”。
The other approach is to simply add tools.jar
to your project's library or point to it in the project path.
另一种方法是简单地添加tools.jar
到项目的库中或在项目路径中指向它。
回答by Stanley
You need to add Tools.jar from the JDK install into your project's build path.
您需要将 JDK 安装中的 Tools.jar 添加到项目的构建路径中。
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.
在包资源管理器中右键单击您的项目,然后转到属性。在左侧,单击“Java 构建路径”。转到“库”选项卡,然后单击“添加外部 JAR”。导航到您的 JDK 安装并转到 LIB 文件夹。选择 tools.jar,然后点击 OK。
回答by Adam Rabung
http://java.sun.com/j2se/javadoc/faq/index.html#com.sun.javadoc
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.
JDK 的 tools.jar 通常不包含在 Eclipse 项目类路径中。如果可以,您应该避免使用 com.sun.* 代码。
回答by Volker Stolz
Do you actually have a JDK installed, or maybe just an JRE?
你真的安装了JDK,或者只是一个JRE?
Also see Depending on com.sun.javadoc from tools.jar (Sun JDK) in Eclipse.