summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/spigotmc/builder/Bootstrap.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/spigotmc/builder/Bootstrap.java')
-rw-r--r--src/main/java/org/spigotmc/builder/Bootstrap.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/org/spigotmc/builder/Bootstrap.java b/src/main/java/org/spigotmc/builder/Bootstrap.java
index 57a2b78..2a1ceba 100644
--- a/src/main/java/org/spigotmc/builder/Bootstrap.java
+++ b/src/main/java/org/spigotmc/builder/Bootstrap.java
@@ -1,5 +1,7 @@
package org.spigotmc.builder;
+import com.google.common.base.Joiner;
+
public class Bootstrap
{
@@ -11,7 +13,7 @@ public class Bootstrap
{
System.err.println( "Outdated Java detected (" + javaVersion + "). BuildTools requires at least Java 7. Please update Java and try again." );
System.err.println( "You may use java -version to double check your Java version." );
- return;
+ System.exit( 1 );
}
if ( javaVersion.getVersion() < JavaVersion.JAVA_8.getVersion() )
@@ -26,6 +28,15 @@ public class Bootstrap
System.err.println( "*** WARNING *** You may use java -version to double check your Java version." );
}
+ long memoryMb = Runtime.getRuntime().maxMemory() >> 20;
+ if ( memoryMb < 512 )
+ {
+ System.err.println( "BuildTools requires at least 512M of memory to run (1024M recommended), but has only detected " + memoryMb + "M." );
+ System.err.println( "This can often occur if you are running a 32-bit system, or one with low RAM." );
+ System.err.println( "Please re-run BuildTools with manually specified memory, e.g: java -Xmx1024M -jar BuildTools.jar " + Joiner.on( ' ' ).join( args ) );
+ System.exit( 1 );
+ }
+
Builder.main( args );
}
}