diff --git a/build.gradle.kts b/build.gradle.kts index ba570ff..75036ed 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -46,6 +46,10 @@ java { } tasks { + withType { + javaCompiler.set(project.javaToolchains.compilerFor(project.java.toolchain)) + } + compileJava { /* Java 8 is the minimum supported version. */ options.release.set(8) @@ -203,16 +207,10 @@ tasks { source = nativeModuleInfoSource options.sourcepath = files(nativeModuleInfoSource.dir) - classpath = files() + classpath = files(compileJava.get().classpath, jar.get().outputs) options.release.set(9) - - afterEvaluate { - options.compilerArgs.add("--module-path") - options.compilerArgs.add(compileJava.get().classpath.asPath + ";" + jar.get().outputs.files.asPath) - options.compilerArgs.add("--module-version") - options.compilerArgs.add("$version") - } + options.javaModuleVersion.set("$version") } create("nativeWinJar") {