From e66758d3d026b5245153653094561313e87a6b53 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Thu, 20 Feb 2020 17:54:30 +0100 Subject: [PATCH] Explicitly set java home in CommandLineInvoker See gh-20242 --- .../boot/cli/infrastructure/CommandLineInvoker.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java index c41f8b50f8..c1a2bffa92 100644 --- a/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java +++ b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java @@ -76,6 +76,7 @@ public final class CommandLineInvoker { command.addAll(Arrays.asList(args)); ProcessBuilder processBuilder = new ProcessBuilder(command).directory(this.workingDirectory); processBuilder.environment().put("JAVA_OPTS", "-Duser.home=" + this.temp); + processBuilder.environment().put("JAVA_HOME", System.getProperty("java.home")); return processBuilder.start(); }