@@ -30,7 +30,7 @@ abstract class InstrumentPostProcessingAction implements Action<AbstractCompile>
3030 abstract WorkerExecutor getWorkerExecutor ()
3131
3232 // Those cannot be private other wise Groovy will fail at runtime with a missing property ex
33- final String javaVersion
33+ final JavaLanguageVersion javaVersion
3434 final ListProperty<String > plugins
3535 final FileCollection instrumentingClassPath
3636 final DirectoryProperty compilerOutputDirectory
@@ -44,7 +44,7 @@ abstract class InstrumentPostProcessingAction implements Action<AbstractCompile>
4444 DirectoryProperty compilerOutputDirectory ,
4545 DirectoryProperty tmpDirectory
4646 ) {
47- this . javaVersion = javaVersion != InstrumentPlugin . DEFAULT_JAVA_VERSION ? " 8 " : javaVersion
47+ this . javaVersion = javaVersion == InstrumentPlugin . DEFAULT_JAVA_VERSION ? JavaLanguageVersion . current() : JavaLanguageVersion . of( javaVersion)
4848 this . plugins = plugins
4949 this . instrumentingClassPath = instrumentingClassPath
5050 this . compilerOutputDirectory = compilerOutputDirectory
@@ -75,7 +75,7 @@ abstract class InstrumentPostProcessingAction implements Action<AbstractCompile>
7575
7676 private workQueue () {
7777 def javaLauncher = this . javaToolchainService. launcherFor { spec ->
78- spec. languageVersion. set(JavaLanguageVersion . of( this . javaVersion) )
78+ spec. languageVersion. set(this . javaVersion)
7979 }. get()
8080 return this . workerExecutor. processIsolation { spec ->
8181 spec. forkOptions { fork ->
0 commit comments