Minor, set JAVA_HOME to JDK 1.8 in LauncherScriptTest

Otherwise the test would invoke the "java" executable from PATH, which
might not be 1.8, and that would cause some tests to fail because error
messages are slightly different in newer Java versions.
This commit is contained in:
Alexander Udalov
2021-07-29 15:41:16 +02:00
parent b1bce6a29e
commit a4730dd57e

View File

@@ -34,7 +34,7 @@ class LauncherScriptTest : TestCaseWithTmpdir() {
expectedStderr: String = "",
expectedExitCode: Int = 0,
workDirectory: File? = null,
environment: Map<String, String> = emptyMap(),
environment: Map<String, String> = mapOf("JAVA_HOME" to KtTestUtil.getJdk8Home().absolutePath),
) {
val executableFileName = if (SystemInfo.isWindows) "$executableName.bat" else executableName
val launcherFile = File(PathUtil.kotlinPathsForDistDirectory.homePath, "bin/$executableFileName")