The example in this article describes the method of automatically generating javadoc documents in eclipse. Share it with everyone for your reference. The specific method is as follows:
There are three main ways to use eclipse to generate documentation (javadoc):
1. Right-click in the project list, select Export, then select javadoc under java in the Export dialog box, and submit to the next step.
There are two places to pay attention to in the Javadoc Generation dialog box:
javadoc command: bin/javadoc.exe of jdk should be selected
destination: is the saving path of the generated document, which can be freely selected.
Press finish to submit to start generating the document.
2. Use the menu to select: File->Export (File->Export),
The remaining steps are the same as the first method.
3. Select the project for which you want to generate documentation, and then use the menu to select,
Project->Generate Javadoc directly enters the Javadoc Generation dialog box. The remaining steps are the same as the first method starting from the Javadoc Generation dialog box.
You can use any method, but you should pay attention to a few issues:
1. Eclipse cannot be generated and an error is reported:
java.lang.IllegalArgumentException at sun.net.www.ParseUtil.decode
, which is caused by setting java environment variables. For example, the classpath is
.;%JAVA_HOME/lib/dt.jar;%JAVA_HOME%/lib/tool.jar. The solution is to delete the classpath or refer to the official document http://maven.apache.org/plugins/maven-javadoc-plugin/ faq.html.
2. The generated document is garbled. Improve api-doc. When using eclipse to generate javadoc, "unmappable characters encoding GBK" occurs. It is actually a character encoding problem. Open eclipse, project -> Generate javadoc and select the project you want to output javadoc one by one. In the last step, add the following code to the VM settings line. Copy the code as follows: -encoding utf-8 -charset utf-8
I hope this article will be helpful to everyone’s Java programming.