From de45b68c909815ce5ea7b6b9e1a2ce3375b6334d Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Thu, 16 Sep 2021 08:49:26 +0200 Subject: [PATCH] LUCENE-9448, LUCENE-9990: fix Luke's launcher task. --- gradle/testing/alternative-jdk-support.gradle | 1 + lucene/luke/build.gradle | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/gradle/testing/alternative-jdk-support.gradle b/gradle/testing/alternative-jdk-support.gradle index d12a39d96dc..d4ab22a9708 100644 --- a/gradle/testing/alternative-jdk-support.gradle +++ b/gradle/testing/alternative-jdk-support.gradle @@ -85,5 +85,6 @@ if (jvmGradle != jvmCurrent) { } // Set up root project's properties. +rootProject.ext.runtimeJavaExecutable = jvmCurrent.javaExecutable rootProject.ext.runtimeJavaHome = jvmCurrent.javaHome rootProject.ext.runtimeJavaVersion = jvmDetector.getMetadata(jvmCurrent.javaHome).languageVersion diff --git a/lucene/luke/build.gradle b/lucene/luke/build.gradle index 9507638c517..5f6e1635375 100644 --- a/lucene/luke/build.gradle +++ b/lucene/luke/build.gradle @@ -133,13 +133,8 @@ task run() { doFirst { logger.lifecycle("Launching Luke ${project.version} right now...") - def javaExecutable = { - def registry = project.extensions.getByType(JavaInstallationRegistry) - def currentJvm = registry.installationForCurrentVirtualMachine.get() - currentJvm.getJavaExecutable().asFile - }() ant.exec( - executable: javaExecutable, + executable: rootProject.ext.runtimeJavaExecutable, spawn: true, vmlauncher: true ) {