Slackbot
11/30/2023, 7:36 PMVampire
12/01/2023, 1:33 AMexecutable in the forkOptions, you could set that to a toolchain executable like
forkOptions.executable = "${javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(21) }.get().executablePath}"
or something similar.
If you want to use worker api, you should not use JavaExec at all, why should you?
Or what do you actually try to achieve?Philip W
12/01/2023, 1:19 PMPhilip W
12/01/2023, 1:20 PMVampire
12/01/2023, 1:29 PMprocessIsolation { ... }.
It is just not as convenient as if it had proper support.Philip W
12/01/2023, 2:16 PMPhilip W
12/05/2023, 4:42 PMVampire
12/05/2023, 4:45 PMPhilip W
12/05/2023, 5:02 PM// This needs to be Java 8
workerExecutor.processIsolation {
it.classpath.from(classpath)
it.forkOptions {
it.executable = jvmToolchain.launcherFor {
it.languageVersion.set(JavaLanguageVersion.of(17))
}.get().executablePath.toString()
}
}.submit(GenerateInterfaces::class.java) {
// This needs to be Java 17
}
And can you explicitly declare the JVM attribute of a configuration?Vampire
12/05/2023, 5:05 PMPhilip W
12/05/2023, 5:11 PMVampire
12/05/2023, 5:19 PMPhilip W
12/05/2023, 5:20 PMVampire
12/05/2023, 5:28 PMPhilip W
12/05/2023, 5:31 PMsubmit call, which is used by Java 8.Vampire
12/05/2023, 5:57 PMWorkAction as part of the plugin code, get an ExecActions injected that then uses javaExec to execute the Java 17 code? And you can remove processIsolation then.
Or you indeed need some Java 8 stubs to compile against and have the Java 17 code for runtime.Vampire
12/05/2023, 5:57 PM