# Javadoc

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Javadoc
> Markdown URL: https://mediated.wiki/source/Javadoc.md
> Source: https://en.wikipedia.org/wiki/Javadoc
> Source revision: 1346043761
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Documentation generator for Java

This article contains instructions or advice. Wikipedia is not a guidebook; please help rewrite such content to be encyclopedic or move it to Wikiversity, Wikibooks, or Wikivoyage. (August 2023)

**Javadoc** (also capitalized as **JavaDoc** or **javadoc**) is an [API](/source/Application_programming_interface) [documentation generator](/source/Documentation_generator) for the [Java programming language](/source/Java_(programming_language)). Based on information in Java [source code](/source/Source_code), Javadoc generates documentation formatted as [HTML](/source/HTML) and other formats via [extensions](/source/Plug-in_(computing)).[1] Javadoc was created by [Sun Microsystems](/source/Sun_Microsystems) and is owned by [Oracle](/source/Oracle_Corporation) today.

The content and formatting of a resulting document are controlled via special [markup](/source/Markup_language) in source code [comments](/source/Comment_(computer_programming)). As this markup is [de facto standard](/source/De_facto_standard) and ubiquitous for documenting Java code,[2] many [IDEs](/source/Integrated_Development_Environment) extract and display the Javadoc information while viewing the source code, often via hover over an associated symbol. Some IDEs, like [IntelliJ IDEA](/source/IntelliJ_IDEA), [NetBeans](/source/NetBeans) and [Eclipse](/source/Eclipse_(software)), support generating Javadoc template comment blocks.[3] The @tag syntax of Javadoc markup has been re-used by other documentation generators, including [Doxygen](/source/Doxygen), [JSDoc](/source/JSDoc), [EDoc](https://www.erlang.org/doc/apps/edoc/chapter.html) and [HeaderDoc](/source/HeaderDoc).

Javadoc supports extension via [doclets](/source/Doclets) and taglets, which allow for generating different output formats and for [static analysis](/source/Static_analysis) of a [codebase](/source/Codebase). For example, [JDiff](/source/JDiff) reports changes between two versions of an API.

Although some criticize Javadoc and API document generators in general, one motivation for creating Javadoc was that more traditional (less automated) API documentation is often out-of-date or does not exist due to business constraints such as limited availability of [technical writers](/source/API_writer).[4]

Javadoc has been part of Java since its first release, and is often updated with each release of the [Java Development Kit](/source/Java_Development_Kit).[5]

Javadoc and the source code comments used by Javadoc, do not affect the performance of a Java executable since comments are ignored by the compiler.

## Markup

Javadoc ignores comments unless they are specially marked. A Javadoc comment is marked with an extra asterisk after the start of a multi-line comment: /**. Following lines are preceded with an *, and the entire comment block should be terminated with a */.

An example of a method Javadoc comment follows:

/**
 * Description of what the method does.
 *
 * @param input Description of parameter.
 * @return Description of return value.
 * @throws Exception Description of exception.
 */
public int methodName(String input) throws Exception { ... }

Some [HTML](/source/HTML) tags, such as <p>, <head>, and <nav>, are supported in Javadoc.[\[1\]](https://stackoverflow.com/questions/16481230/allowed-html-tags-in-javadoc)

## Markdown

From Java 23 onwards, Javadoc supports the [Markdown](/source/Markdown) standard CommonMark on comment lines that start with /// instead of the older multiline format.[6]

## Doclets

A Doclet program works with Javadoc to select which content to include in the documentation, format the presentation of the content and create the file that contains the documentation.[7] A Doclet is written in Java and uses the [Doclet API](https://docs.oracle.com/en/java/javase/24/docs/api/jdk.javadoc/jdk/javadoc/doclet/package-summary.html),

The [StandardDoclet](https://docs.oracle.com/en/java/javase/24/docs/api/jdk.javadoc/jdk/javadoc/doclet/StandardDoclet.html)[\[2\]](https://docs.oracle.com/javase/9/javadoc/javadoc-command.htm#JSJAV-GUID-04BFA924-7C45-4E9C-91D1-0B77D97E65AB) included with Javadoc generates [API](/source/API) documentation as frame-based [HTML](/source/HTML) files. Other Doclets are available on the web [*[citation needed](https://en.wikipedia.org/wiki/Wikipedia:Citation_needed)*], often for free. These can be used to:

- Create other types of documentation (non-API)

- Output to a format other than HTML, such as [PDF](/source/PDF)

- Output as HTML with additional features such as a search or with embedded [UML](/source/Unified_Modeling_Language) diagrams generated from the Java classes

## Tags

This section's factual accuracy may be compromised due to out-of-date information. The reason given is: Should be updated according to the official documentation. Please help update this article to reflect recent events or newly available information. (November 2023)

Some of the available Javadoc tags[8] are listed in the table below:

Syntax Usage Applies to Since @author name Identifies the author such as "Pat Smith" Class, Interface, Enum {@docRoot} Represents the relative path to the generated document's root directory from any generated page Class, Interface, Enum, Field, Method @version version Version information Module, Package, Class, Interface, Enum @since since-text Describes when this functionality first existed Class, Interface, Enum, Field, Method @see reference Links to other element of documentation Class, Interface, Enum, Field, Method @param name description Describes a method parameter Method @return description Describes the return value Method @exception classname description @throws classname description Describes an exception that may be thrown from this method Method @deprecated description Marks the method as outdated Class, Interface, Enum, Field, Method {@inheritDoc} Copies the description from the overridden method Overriding Method 1.4.0 {@link reference} Link to other symbol Class, Interface, Enum, Field, Method {@linkplain reference} Identical to {@link}, except the link's label is displayed in plain text than code font Class, Interface, Enum, Field, Method {@value #STATIC_FIELD} Return the value of a static field Static Field 1.4.0 {@code literal} Formats literal text in the code font; equivalent to {@literal} Class, Interface, Enum, Field, Method 1.5.0 {@literal literal} Denotes literal text; the enclosed text is interpreted as not containing HTML markup or nested javadoc tags Class, Interface, Enum, Field, Method 1.5.0 {@serial literal} Denotes a default serializable field Field {@serialData literal} Denotes data written by the writeObject( ) or writeExternal( ) methods Field, Method {@serialField literal} Denotes an ObjectStreamField component Field

## See also

- [Comparison of documentation generators](/source/Comparison_of_documentation_generators)

- [Doxygen](/source/Doxygen)

- [.NET XML documentation comments](/source/.NET_documentation_comments)

## References

1. **[^](#cite_ref-1)** ["Javadoc"](https://web.archive.org/web/20170613233020/http://agile.csc.ncsu.edu/SEMaterials/tutorials/javadoc/). *agile.csc.ncsu.edu*. Archived from [the original](http://agile.csc.ncsu.edu/SEMaterials/tutorials/javadoc/) on 13 June 2017. Retrieved 12 January 2022.

1. **[^](#cite_ref-2)** ["javadoc - The Java API Documentation Generator"](http://docs.oracle.com/javase/1.5.0/docs/tooldocs/solaris/javadoc.html). [Sun Microsystems](/source/Sun_Microsystems). Retrieved 2011-09-30..

1. **[^](#cite_ref-3)** [IntelliJ IDEA](https://www.jetbrains.com/idea/), [NetBeans](http://www.netbeans-blog.org/netbeans-ide/generating-javadoc-for-a-project-in-netbeans-ide.html) [Archived](https://web.archive.org/web/20170405230224/http://www.netbeans-blog.org/netbeans-ide/generating-javadoc-for-a-project-in-netbeans-ide.html) 2017-04-05 at the [Wayback Machine](/source/Wayback_Machine) and [Eclipse](https://www.eclipse.org/)

1. **[^](#cite_ref-4)** Venners, Bill; Gosling, James; et al. (2003-07-08). ["Visualizing with JavaDoc"](http://www.artima.com/intv/jackpot3.html). artima.com. Retrieved 2013-01-19. When I did the original JavaDoc in the original compiler, even the people close around me pretty soundly criticized it. And it was interesting, because the usual criticism was: a good tech writer could do a lot better job than the JavaDoc does. And the answer is, well, yeah, but how many APIs are actually documented by good tech writers? And how many of them actually update their documentation often enough to be useful?

1. **[^](#cite_ref-5)** ["How to Write Doc Comments for the Javadoc Tool"](http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html). [Sun Microsystems](/source/Sun_Microsystems). Retrieved 2011-09-30..

1. **[^](#cite_ref-6)** ["JEP 467: Markdown Documentation Comments"](https://openjdk.org/jeps/467). *OpenJDK*. 2023-09-11. Retrieved 2025-09-10.

1. **[^](#cite_ref-7)** ["Doclet Overview"](https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/doclet/overview.html).

1. **[^](#cite_ref-8)** [JavaSE 13 Documentation Comment Specification](https://docs.oracle.com/en/java/javase/13/docs/specs/javadoc/doc-comment-spec.html)

## External links

- [Javadoc Tool Home Page](https://www.oracle.com/java/technologies/javase/javadoc.html)

- [Java Platform, Standard Edition Javadoc Guide](https://docs.oracle.com/en/java/javase/25/javadoc/javadoc-tool.html)

- [JSR 260](https://www.jcp.org/en/jsr/detail?id=260) Javadoc Tag Technology Update [Java Specification Request](/source/Java_Specification_Request) (defines new Javadoc tags)

- [Improve on Javadoc with ashkelon](https://web.archive.org/web/20130927133806/https://today.java.net/pub/a/today/2004/08/26/ashkelon.html)

- [Various Java documentations converted to Windows Help format](https://javadoc.allimant.org/)

---
Adapted from the Wikipedia article [Javadoc](https://en.wikipedia.org/wiki/Javadoc) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Javadoc?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
