From a7829bfaaddcf0eac35036c54d90a11e2c01f2da Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 5 Jan 2015 14:46:07 +1100 Subject: Remove the need for JDK to be installed. --- src/main/java/org/spigotmc/builder/Builder.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/spigotmc/builder/Builder.java b/src/main/java/org/spigotmc/builder/Builder.java index cc0b8b7..52bee85 100644 --- a/src/main/java/org/spigotmc/builder/Builder.java +++ b/src/main/java/org/spigotmc/builder/Builder.java @@ -368,7 +368,11 @@ public class Builder public static int runProcess(File workDir, String... command) throws Exception { - final Process ps = new ProcessBuilder( command ).directory( workDir ).start(); + ProcessBuilder pb = new ProcessBuilder( command ); + pb.directory( workDir ); + pb.environment().put( "JAVA_HOME", System.getProperty( "java.home" ) ); + + final Process ps = pb.start(); new Thread( new StreamRedirector( ps.getInputStream(), System.out ) ).start(); new Thread( new StreamRedirector( ps.getErrorStream(), System.err ) ).start(); -- cgit v1.2.3