diff options
author | snowleo <schneeleo@gmail.com> | 2011-06-23 12:38:21 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-06-23 12:38:21 +0200 |
commit | c6aa5f1e6858095554713520bcbce616ef10834e (patch) | |
tree | ed6b6ee84e2d123d8cdab8eda16d417203b6669f | |
parent | a16ced78a51d00f2e29bc5044471c6b5bba54f75 (diff) | |
download | Essentials-c6aa5f1e6858095554713520bcbce616ef10834e.tar Essentials-c6aa5f1e6858095554713520bcbce616ef10834e.tar.gz Essentials-c6aa5f1e6858095554713520bcbce616ef10834e.tar.lz Essentials-c6aa5f1e6858095554713520bcbce616ef10834e.tar.xz Essentials-c6aa5f1e6858095554713520bcbce616ef10834e.zip |
Check java version to be at least 1.6
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Essentials.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 901d55107..c89de0012 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -95,6 +95,11 @@ public class Essentials extends JavaPlugin implements IEssentials public void onEnable() { + final String[] javaversion = System.getProperty("java.version").split("\\.", 3); + if (javaversion == null || javaversion.length < 2 || Integer.parseInt(javaversion[1]) < 6) + { + logger.log(Level.SEVERE, "Java version not supported! Please install Java 1.6. You have " + System.getProperty("java.version")); + } if (enableErrorLogging) { logger.addHandler(errorHandler); @@ -146,9 +151,12 @@ public class Essentials extends JavaPlugin implements IEssentials if (permissionsPlugin != null) { - if (permissionsPlugin.getDescription().getVersion().charAt(0) == '3') { + if (permissionsPlugin.getDescription().getVersion().charAt(0) == '3') + { this.permissionsHandler = new Permissions3Handler(permissionsPlugin); - } else { + } + else + { this.permissionsHandler = new Permissions2Handler(permissionsPlugin); } } @@ -398,8 +406,9 @@ public class Essentials extends JavaPlugin implements IEssentials continue; } - PluginCommand pc = getServer().getPluginCommand(desc.getName()+":"+commandLabel); - if (pc != null) { + PluginCommand pc = getServer().getPluginCommand(desc.getName() + ":" + commandLabel); + if (pc != null) + { return pc.execute(sender, commandLabel, args); } } |