Eclipse 生成 Javadoc 向导:什么是“Javadoc 命令”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3091711/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 16:22:33  来源:igfitidea点击:

Eclipse Generate Javadoc Wizard: what is "Javadoc Command"?

javaeclipsejavadoc

提问by Mr. Boy

I want to generate the javadocs for an open-source code-base I'm using. But I'm being asked for a "Javadoc Command" by the Eclipse Generate JavaDoc wizard and the help doesn't explain what this means. Is it wanting the path to the javadoc binary/jar or something else?

我想为我正在使用的开源代码库生成 javadoc。但是 Eclipse Generate JavaDoc 向导要求我提供“Javadoc 命令”,帮助并没有解释这意味着什么。它是想要 javadoc 二进制文件/jar 的路径还是其他东西?

采纳答案by Michael Borgwardt

Yes, presumably it wants the path to the javadoccommand line toolthat comes with the JDK (in the bin directory, same as javaand javac).

是的,大概它想要JDK附带的javadoc命令行工具的路径(在bin目录中,与java和相同javac)。

Eclipse should be able to find it automatically; are you perhaps running it on a JRE? That would explain the request.

Eclipse 应该能够自动找到它;你可能在 JRE 上运行它吗?这将解释请求。

回答by Andreas Dolk

Yes, it is asking for the application/executable that is capable of creating Javadoc. There is a javadocexecutable inside the jdk's bin folder.

是的,它要求能够创建 Javadoc 的应用程序/可执行文件。javadocjdk 的 bin 文件夹中有一个可执行文件。

回答by Marina Tanasyuk

You may need to add a JDK (Java Development Kit) to the installed JRE's within Eclipse

您可能需要在 Eclipse 中向已安装的 JRE 添加 JDK(Java 开发工具包)

Go to Window->Preferences->Java->Installed JRE's

转到 Window->Preferences->Java->Installed JRE's

In the Name column if you do not have a JDK as your default, then you will need to add it.

在 Name 列中,如果您没有将 JDK 作为默认设置,则需要添加它。

Click the "Add" Button and locate the JDK on your machine. You may find it in this location: C:\Program Files\Java\jdk1.x.y
Where x and y are numbers.

单击“添加”按钮并在您的机器上找到 JDK。您可以在以下位置找到它:C:\Program Files\Java\jdk1.xy
其中 x 和 y 是数字。

If there are no JDK's installed on your machine then download and install the Java SE (Standard Edition) from the Oracle website.

如果您的机器上没有安装 JDK,请从 Oracle 网站下载并安装 Java SE(标准版)。

Then do the steps above again. Be sure that it is set as the default JRE to use.

然后再次执行上述步骤。确保将其设置为要使用的默认 JRE。

Then go back to the Projects->Generate Javadoc... dialog

然后返回到 Projects->Generate Javadoc... 对话框

Now it should work.

现在它应该可以工作了。

Good Luck.

祝你好运。

回答by bbvg

Had this problem and solved typing this : C:\Program Files (x86)\Java\jdk1.7.0_51\bin\javadoc.exe

遇到了这个问题并解决了输入:C:\Program Files (x86)\Java\jdk1.7.0_51\bin\javadoc.exe

回答by AndyBaba

There are already useful answers to this question above, however there is one more possibility which I don't see being addressed here.

上面这个问题已经有了有用的答案,但是还有一种可能性,我认为这里没有解决。

We should consider that the java is installed correctly (that's why eclipse could have been launched in the first place), and the JDK is also added correctly to the eclipse. So the issue might be for some reason (e.g. migration of eclipse to another OS) the path for javadoc is not right which you can easily check and modify in the javadoc wizard page. Here is detailed instructions:

我们应该考虑到 java 安装正确(这就是为什么首先可以启动 eclipse),并且 JDK 也正确添加到 eclipse 中。因此,问题可能是由于某种原因(例如将 eclipse 迁移到另一个操作系统),javadoc 的路径不正确,您可以在 javadoc 向导页面中轻松检查和修改。以下是详细说明:

  1. Open the javadoc wizard by Project->Generate Javadoc...
  2. In the javadoc wizard window make sure the javadoc commandpath is correct as illustrated in below screenshot:
  1. 通过以下方式打开 javadoc 向导 Project->Generate Javadoc...
  2. 在 javadoc 向导窗口中,确保javadoc command路径正确,如下图所示:

EclipseJavadocWizard

EclipseJava 文档向导