summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-11-24 10:03:35 +1100
committermd_5 <git@md-5.net>2018-11-24 10:03:35 +1100
commit38861e44fd75b4ccbc42722ec4abbc9e6eb86926 (patch)
tree918be0f51e669680a61477b89950d995210f7d8f /src/main/java/org
parent228fddc1b71cbdc0b53546b5b7145bcc51a37ead (diff)
downloadbuildtools-38861e44fd75b4ccbc42722ec4abbc9e6eb86926.tar
buildtools-38861e44fd75b4ccbc42722ec4abbc9e6eb86926.tar.gz
buildtools-38861e44fd75b4ccbc42722ec4abbc9e6eb86926.tar.lz
buildtools-38861e44fd75b4ccbc42722ec4abbc9e6eb86926.tar.xz
buildtools-38861e44fd75b4ccbc42722ec4abbc9e6eb86926.zip
Use BuildTools java version to invoke external java tools
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/spigotmc/builder/Builder.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/org/spigotmc/builder/Builder.java b/src/main/java/org/spigotmc/builder/Builder.java
index cfd0255..8181bff 100644
--- a/src/main/java/org/spigotmc/builder/Builder.java
+++ b/src/main/java/org/spigotmc/builder/Builder.java
@@ -374,7 +374,7 @@ public class Builder
File finalMappedJar = new File( workDir, "mapped." + mappingsVersion + ".jar" );
if ( !finalMappedJar.exists() )
{
- System.out.println( "Final mapped jar: " + finalMappedJar + " does not exist, creating!" );
+ System.out.println( "Final mapped jar: " + finalMappedJar + " does not exist, creating (please wait)!" );
File clMappedJar = new File( finalMappedJar + "-cl" );
File mMappedJar = new File( finalMappedJar + "-m" );
@@ -632,6 +632,14 @@ public class Builder
private static int runProcess0(File workDir, String... command) throws Exception
{
+ Preconditions.checkArgument( workDir != null, "workDir" );
+ Preconditions.checkArgument( command != null && command.length > 0, "Invalid command" );
+
+ if ( command[0].equals( "java" ) )
+ {
+ command[0] = System.getProperty( "java.home" ) + "/bin/" + command[0];
+ }
+
ProcessBuilder pb = new ProcessBuilder( command );
pb.directory( workDir );
pb.environment().put( "JAVA_HOME", System.getProperty( "java.home" ) );