Gradle Template for Processing 4.x with Java 17 (IntelliJ/VS Code ready)

Thanks @noah-devtech!

Cool beans! It worked as is.

I trimmed it down for my use case with VS Code and JAVA2D, P2D and P3D sketches on Windows 10 and it worked.

I only added this file to my project:

build.gradle.kts

plugins {
    id("java")
    id("application")
}

repositories {
    mavenCentral()
}

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(17))
    }
}

val processingVersion = "4.5.3"
val joglVersion = "2.6.0"

dependencies {
    implementation("org.processing:core:$processingVersion")

    // Core JOGL Modules
    //implementation("org.jogamp.jogl:jogl:$joglVersion")
    //implementation("org.jogamp.jogl:nativewindow:$joglVersion")
    //implementation("org.jogamp.jogl:newt:$joglVersion")
    //implementation("org.jogamp.gluegen:gluegen-rt:$joglVersion")

    // Required on Windows 10 for P2D/P3D.
    // implementation("org.processing:core:$processingVersion") works for JAVA2D,
    // but P2D/P3D also need these Windows native JogAmp runtime artifacts.
    runtimeOnly("org.jogamp.jogl:jogl:$joglVersion:natives-windows-amd64")
    runtimeOnly("org.jogamp.jogl:nativewindow:$joglVersion:natives-windows-amd64")
    runtimeOnly("org.jogamp.jogl:newt:$joglVersion:natives-windows-amd64")
    runtimeOnly("org.jogamp.gluegen:gluegen-rt:$joglVersion:natives-windows-amd64")

    // Direct Windows Natives
    runtimeOnly("org.jogamp.jogl:jogl:$joglVersion:natives-windows-amd64")
    runtimeOnly("org.jogamp.jogl:nativewindow:$joglVersion:natives-windows-amd64")
    runtimeOnly("org.jogamp.jogl:newt:$joglVersion:natives-windows-amd64")
    runtimeOnly("org.jogamp.gluegen:gluegen-rt:$joglVersion:natives-windows-amd64")
}

application {
    mainClass.set("MyTest")
}

:)