Explicitly set java home in CommandLineInvoker

See gh-20242
This commit is contained in:
dreis2211
2020-02-20 17:54:30 +01:00
committed by Stephane Nicoll
parent e73ee7b3fe
commit e66758d3d0

View File

@@ -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();
}