Having problems whit making a jar

Hi, I’m trying to export my project into a runnable jar file, I’m using the library org.json for my project but ether I do not have the org.json library or it doesn’t export a jar file at all

my build.gradle

plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.json:json:20211205'
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
}

jar {
    manifest {
        attributes 'Main-Class': 'me.alien.colab.game.Game'
    }

    from {
        configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
    }
}

test {
    useJUnitPlatform()
}

my current issue

Could not determine the dependencies of task ':jar'.
> No such property: isDirectory for class: java.io.File
  Possible solutions: directory