From 737c162fe28009d809079d5eb9a524ab085155f4 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Wed, 7 Jul 2021 06:18:02 -0700
Subject: [PATCH] [ci skip] Use Java toolchain for run tasks (#6108)

---
 patches/server/Setup-Gradle-project.patch | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch
index ca9f1923ca..ac1ae8a6da 100644
--- a/patches/server/Setup-Gradle-project.patch
+++ b/patches/server/Setup-Gradle-project.patch
@@ -135,6 +135,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +    doFirst {
 +        workingDir.mkdirs()
 +    }
++    javaLauncher.set(project.javaToolchains.launcherFor {
++        languageVersion.set(JavaLanguageVersion.of(project.tasks.compileJava.get().options.release.get()))
++    })
 +    block(this)
 +}
 +