# Javadoc Note: This guide applies to Dokka Gradle plugin (DGP) v2 mode. The DGP v1 mode is no longer supported. To upgrade from v1 to v2 mode, follow the [Migration guide](dokka-migration.html). Dokka's Javadoc output format is a lookalike of Java's [Javadoc HTML format](https://docs.oracle.com/en/java/javase/19/docs/api/index.html). It tries to visually mimic HTML pages generated by the Javadoc tool, but it's not a direct implementation or an exact copy. ![Screenshot of Javadoc output format](images/javadoc-format-example.png) All Kotlin code and signatures are rendered as seen from Java's perspective. This is achieved with our [Kotlin as Java Dokka plugin](https://github.com/Kotlin/dokka/tree/2.2.0/dokka-subprojects/plugin-kotlin-as-java), which comes bundled and applied by default for this format. The Javadoc output format is implemented as a [Dokka plugin](dokka-plugins.html), and it is maintained by the Dokka team. It is open source, and you can find the source code on [GitHub](https://github.com/Kotlin/dokka/tree/2.2.0/dokka-subprojects/plugin-javadoc). ## Generate Javadoc documentation Tip: Dokka doesn't support the Javadoc format for multi-project builds or Kotlin Multiplatform projects. Gradle Kotlin DSL: The [Gradle plugin for Dokka](dokka-gradle.html) comes with the Javadoc output format included. You need to apply the corresponding plugin ID in the `plugins {}` block of your project's `build.gradle.kts` file: ```KOTLIN plugins { id("org.jetbrains.dokka-javadoc") version "2.2.0" } ``` Once you applied the plugin, you can run the following tasks: * `dokkaGenerate` to generate documentation in [all available formats based on the applied plugins](dokka-gradle.html#configure-documentation-output-format). * `dokkaGeneratePublicationJavadoc` to generate documentation only in Javadoc format. The `javadoc.jar` file can be generated separately. For more information, see [Building javadoc.jar](dokka-gradle.html#build-javadoc-jar). Maven: The [Maven plugin for Dokka](dokka-maven.html) comes with the Javadoc output format built in. You can generate documentation by using the following goals: | Goal |Description | --------------------- | `dokka:javadoc` |Generates documentation in Javadoc format | | `dokka:javadocJar` |Generates a `javadoc.jar` file that contains documentation in Javadoc format | CLI: Since the Javadoc output format is a [Dokka plugin](dokka-plugins.html#apply-dokka-plugins), you need to [download the plugin's JAR file](https://repo1.maven.org/maven2/org/jetbrains/dokka/javadoc-plugin/2.2.0/javadoc-plugin-2.2.0.jar). The Javadoc output format has two dependencies that you need to provide as additional JAR files: * [kotlin-as-java plugin](https://repo1.maven.org/maven2/org/jetbrains/dokka/kotlin-as-java-plugin/2.2.0/kotlin-as-java-plugin-2.2.0.jar) * [korte-jvm](https://repo1.maven.org/maven2/com/soywiz/korlibs/korte/korte-jvm/3.3.0/korte-jvm-3.3.0.jar) Via [command line options](dokka-cli.html#run-with-command-line-options): ```BASH java -jar dokka-cli-2.2.0.jar \ -pluginsClasspath "./dokka-base-2.2.0.jar;...;./javadoc-plugin-2.2.0.jar" \ ... ``` Via [JSON configuration](dokka-cli.html#run-with-json-configuration): ```JSON { ... "pluginsClasspath": [ "./dokka-base-2.2.0.jar", "...", "./kotlin-as-java-plugin-2.2.0.jar", "./korte-jvm-3.3.0.jar", "./javadoc-plugin-2.2.0.jar" ], ... } ``` For more information, see [Other output formats](dokka-cli.html#other-output-formats) in the CLI runner's documentation.