# How to use jlink or jpackage without other plugin?

**URL:** <https://discuss.gradle.org/t/how-to-use-jlink-or-jpackage-without-other-plugin/46544>\
**Category:** Help/Discuss\
**Created:** [September 22, 2023, 7:20am UTC](https://discuss.gradle.org/t/how-to-use-jlink-or-jpackage-without-other-plugin/46544 "2023-09-22T07:20:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iseki0](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/iseki0/32/10886_2.png) [@iseki0](https://discuss.gradle.org/u/iseki0)\
**Post date:** [September 22, 2023, 7:20am UTC](https://discuss.gradle.org/t/how-to-use-jlink-or-jpackage-without-other-plugin/46544/1 "2023-09-22T07:20:18Z")

</div>

I can’t find any description in the Gradle documents about jlink and jpackage supports.  
Before that I’m trying to use `org.beryx.jlink`. But look like the plugin has bad supports for `Auto-Module-Name` attribute in the `MANIFEST.MF`.  
So, are there anything about it?  
Thank you.

---

<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:** [September 22, 2023, 8:33am UTC](https://discuss.gradle.org/t/how-to-use-jlink-or-jpackage-without-other-plugin/46544/2 "2023-09-22T08:33:38Z")

</div>

There is no built-in support for `jlink` or `jpackage`.  
We just use an `Exec` task or `exec { ... }` closure to call it.  
You also have to be sensitive to which `jlink` you use.  
Previously we took the `jlink` of the Java that runs Gradle by using `java.util.spi.ToolProvider`,  
but recently that broke when we ran Gradle with Java 11.0.11 but tried to jlink a Java 11.0.19 JRE,  
because the Java devs introduced a major breaking change in a minor update, where the hashsum calculation for JMODs changes, which causes that for example 11.0.11 jlink cannot run on 11.0.19 JMODs and 11.0.19 jlink cannot run on 11.0.11 JMODs.  
For us I changed the logic, so that it always uses the jlink tool of the target JDK to prevent such problems in the future.

---

<div class="post-metadata">

**Author:** ![iseki0](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/iseki0/32/10886_2.png) [@iseki0](https://discuss.gradle.org/u/iseki0)\
**Post date:** [September 22, 2023, 8:55am UTC](https://discuss.gradle.org/t/how-to-use-jlink-or-jpackage-without-other-plugin/46544/3 "2023-09-22T08:55:49Z")

</div>

Are there any plan to add to add supports for it?

---

<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:** [September 22, 2023, 11:43am UTC](https://discuss.gradle.org/t/how-to-use-jlink-or-jpackage-without-other-plugin/46544/4 "2023-09-22T11:43:01Z")

</div>

I have no idea, I’m not affiliated to Gradle
