From 5e5038c83936db8711bd0570b8edeb250f68cf26 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 8 Feb 2014 09:40:08 +1100 Subject: [PATCH] Fix Java 7 detection - closes #861 --- .../src/main/java/net/md_5/bungee/Bootstrap.java | 15 ++++++--------- proxy/src/main/java/Test.java | 3 --- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java index 8fbd6537..5426d0fa 100644 --- a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java +++ b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java @@ -27,6 +27,12 @@ public class Bootstrap */ public static void main(String[] args) throws Exception { + if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 51.0 ) + { + System.err.println( "*** ERROR *** BungeeCord requires Java 7 or above to function!" ); + return; + } + OptionParser parser = new OptionParser(); parser.allowsUnrecognizedOptions(); parser.acceptsAll( list( "v", "version" ) ); @@ -39,13 +45,6 @@ public class Bootstrap return; } - - if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 51.0 ) - { - System.err.println( "*** ERROR *** BungeeCord requires Java 7 or above to function!" ); - return; - } - if ( BungeeCord.class.getPackage().getSpecificationVersion() != null && System.getProperty( "IReallyKnowWhatIAmDoingISwear" ) == null ) { Calendar deadline = Calendar.getInstance(); @@ -60,8 +59,6 @@ public class Bootstrap } } - System.setProperty( "java.net.preferIPv4Stack", "true" ); - BungeeCord bungee = new BungeeCord(); ProxyServer.setInstance( bungee ); bungee.getLogger().info( "Enabled BungeeCord version " + bungee.getVersion() ); diff --git a/proxy/src/main/java/Test.java b/proxy/src/main/java/Test.java index cc08bad4..9d51608d 100644 --- a/proxy/src/main/java/Test.java +++ b/proxy/src/main/java/Test.java @@ -17,9 +17,6 @@ public class Test public static void main(String[] args) throws Exception { - - System.setProperty( "java.net.preferIPv4Stack", "true" ); - BungeeCord bungee = new BungeeCord(); ProxyServer.setInstance( bungee ); bungee.getLogger().info( "Enabled BungeeCord version " + bungee.getVersion() );