How to fix the error of launching the task group "distribution" in gradle?

I created a javafx project using gradle. I manage to build an executable image and run it. But when I run any task from the “distribution” group, I get an error, how do I fix it?


plugins {
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.10'
    id 'org.beryx.jlink' version '2.24.4'

repositories {

application {
    mainModule = 'pigletmodule'
    mainClass = 'piglet.Main'

javafx {
    version = "17.0.1"
    modules = ['javafx.controls']

jlink {
    options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
    launcher {
        name = 'piglet'

The error text.

> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :jar UP-TO-DATE
> Task :startScripts FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':startScripts'.
> Couldn't replace placeholder in C:\Users\insec\Desktop\piglet\build\scripts\piglet