# Execution failed for task ':extensions:policies:javadoc' error

**URL:** <https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371>\
**Category:** Help/Discuss\
**Created:** [January 4, 2024, 11:59am UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371 "2024-01-04T11:59:39Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ntepe](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@ntepe](https://discuss.gradle.org/u/ntepe)\
**Post date:** [January 4, 2024, 11:59am UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/1 "2024-01-04T11:59:39Z")

</div>

Hello everyone.

I try to build a project through gradle. The project runs with gradle 8.1.1 and java open jdk 17 and i take this error:

```plaintext
(Execution failed for task ':extensions:policies:javadoc'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): '/home/datamiteedc/Desktop/Dataspace/MinimumViableDataspace/extensions/policies/build/tmp/javadoc/javadoc.options'). 

```

Is there a solution to this? propably some conflict with gradle and jdk? or something else? is there a code to put into javadoc.options file to prevent this error?

Thanks

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [January 4, 2024, 12:09pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/2 "2024-01-04T12:09:23Z")

</div>

You do not put anything into that file.  
Gradle generates this file.  
You can look at it to see what might be the problem.  
Can you share a build `--scan`?  
Maybe also `--info` or `--debug` could give further insight.

---

<div class="post-metadata">

**Author:** ![ntepe](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@ntepe](https://discuss.gradle.org/u/ntepe)\
**Post date:** [January 4, 2024, 1:16pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/3 "2024-01-04T13:16:55Z")

</div>

here you are [Build Scan® | Gradle Cloud Services](https://scans.gradle.com/s/igctb75kaei5c) . Thanks for the answer

---

<div class="post-metadata">

**Author:** ![ntepe](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@ntepe](https://discuss.gradle.org/u/ntepe)\
**Post date:** [January 4, 2024, 1:20pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/4 "2024-01-04T13:20:42Z")

</div>

Especially its this project that i want to build.  
[GitHub - eclipse-edc/MinimumViableDataspace: Guidance on documentation, scripts and integration steps on using the EDC project results](https://github.com/eclipse-edc/MinimumViableDataspace?tab=readme-ov-file) . And i tried to build it through this command “./gradlew build -x test” from this link [MinimumViableDataspace/system-tests/README.md at main · eclipse-edc/MinimumViableDataspace · GitHub](https://github.com/eclipse-edc/MinimumViableDataspace/blob/main/system-tests/README.md) . And take this error i mentioned on previous comments.

---

<div class="post-metadata">

**Author:** ![ntepe](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@ntepe](https://discuss.gradle.org/u/ntepe)\
**Post date:** [January 4, 2024, 1:22pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/5 "2024-01-04T13:22:01Z")

</div>

also i changed the gradle version through properties file to 8.5 from 8.1.1 but nothing changed. same error.

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [January 4, 2024, 1:25pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/6 "2024-01-04T13:25:30Z")

</div>

> Cannot run program “/usr/lib/jvm/java-17-openjdk-amd64/bin/javadoc” (in directory “/home/datamiteedc/Desktop/Dataspace/MinimumViableDataspace/extensions/policies”): error=2, No such file or directory

The build scan shows, that you run Gradle with Java 21.  
As Java 17 is used to produce the JavaDoc, there is a toolchain of Java 17 configured.  
The Java 17 toolchain found on your system is only a JRE though, not a JDK and so the `javadoc` tool is not found.  
Install the `openjdk-17-jdk-headless` package, then your JRE is expanded to a JDK and the build should continue.

> also i changed the gradle version through properties file to 8.5 from 8.1.1 but nothing changed. same error.

When running on 8.1.1, you must not use Java 21 to execute Gradle anyway. Gradle 8.5 is the first version to officially support running on Java 21: [Compatibility Matrix](https://docs.gradle.org/current/userguide/compatibility.html)

---

<div class="post-metadata">

**Author:** ![ntepe](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@ntepe](https://discuss.gradle.org/u/ntepe)\
**Post date:** [January 4, 2024, 2:31pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/7 "2024-01-04T14:31:10Z")

</div>

i typed sudo apt install openjdk-17-jdk-headless and then i typed java -version and didnt tell something about headless as you see in the screen. how can i know if headless its installed?

 ![image](https://global.discourse-cdn.com/gradle/original/2X/5/51653a0fedf2e4a86faaa089e5041ca59ad655ff.jpeg)

---

<div class="post-metadata">

**Author:** ![ntepe](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@ntepe](https://discuss.gradle.org/u/ntepe)\
**Post date:** [January 4, 2024, 2:33pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/8 "2024-01-04T14:33:54Z")

</div>

and now i have this error with --scan. [Build Scan® | Gradle Cloud Services](https://scans.gradle.com/s/apkrtlsz6ladg)

---

<div class="post-metadata">

**Author:** ![ntepe](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@ntepe](https://discuss.gradle.org/u/ntepe)\
**Post date:** [January 4, 2024, 2:48pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/9 "2024-01-04T14:48:24Z")

</div>

so last runs was in my laptop. and now i update the gradle and in my laptop and its passed successfully. tomorow that i make the same process in the virtual machine i will tell you if i will get any error. thanks for now. i think that the difference with virtual machine is that in my laptop i have openjdk17 and on my laptop have openjdk17-headless. whats the difference of two?

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [January 4, 2024, 2:57pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/10 "2024-01-04T14:57:49Z")

</div>

Shouldn’t be much difference.  
`headless` means no GUI.  
`openjdk-17-jdk` Ubuntu package depends on `openjdk-17-jdk-headless` actually.  
It additionally depends for example on `visualvm` which is a GUI tool and thus is not available on a headless system.

---

<div class="post-metadata">

**Author:** ![ntepe](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@ntepe](https://discuss.gradle.org/u/ntepe)\
**Post date:** [January 4, 2024, 3:06pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/11 "2024-01-04T15:06:38Z")

</div>

so why if i have openjdk gives me an error and if i have openjdk-headless don’t? because ubuntu package depends on headless? thanks

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [January 4, 2024, 3:44pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/12 "2024-01-04T15:44:21Z")

</div>

I don’t know.  
As I said, headless or not headless shouldn’t make a difference.  
It is the same.  
Probably some other problem why it didn’t work on one but work on the other.

---

<div class="post-metadata">

**Author:** ![ntepe](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@ntepe](https://discuss.gradle.org/u/ntepe)\
**Post date:** [January 5, 2024, 8:58am UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/13 "2024-01-05T08:58:12Z")

</div>

ok this one passed. i have one last command that doesn’t pass. “./gradlew :system-tests:test -DincludeTags=“ComponentTest,EndToEndTest””. I take this error on the link ([Build Scan® | Gradle Cloud Services](https://scans.gradle.com/s/mam2ejc72p6z4) ). can you tell me what is this error about so i can solve it because i don’t understand? thanks

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [January 5, 2024, 9:05am UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/14 "2024-01-05T09:05:00Z")

</div>

What do you not understand?  
[https://scans.gradle.com/s/mam2ejc72p6z4/tests/overview](https://scans.gradle.com/s/mam2ejc72p6z4/tests/overview)  
There are 11 tests.  
1 is skipped.  
1 is successfull.  
9 failed.

---

<div class="post-metadata">

**Author:** ![ntepe](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@ntepe](https://discuss.gradle.org/u/ntepe)\
**Post date:** [January 5, 2024, 9:14am UTC](https://discuss.gradle.org/t/execution-failed-for-task-policies-javadoc-error/47371/15 "2024-01-05T09:14:36Z")

</div>

ok thanks for the help. i appreciate it.
