Many poeple don’t like to read decription, documentation and other notes from developers which was wrote for their. This code blocks any runs the application if Java specification version is not the same that required. Also, for Game Server case added notification about Java model x32/x64 for avoid problems with memory overflow.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
#P aCis_gameserver Index: java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- java/net/sf/l2j/gameserver/GameServer.java (revision 100500) +++ java/net/sf/l2j/gameserver/GameServer.java (working copy) @@ -123,6 +123,12 @@ public GameServer() throws Exception { + if (!System.getProperty("java.specification.version").equals("1.8")) + { + System.out.println("This application require Java 8. Please update your Java version."); + System.exit(1); + } + // Create log folder new File("./log").mkdir(); new File("./log/chat").mkdir(); @@ -138,6 +144,12 @@ LogManager.getLogManager().readConfiguration(is); } + if (!System.getProperty("sun.arch.data.model").equals("64")) + { + StringUtil.printSection("Notification"); + _log.info("This application require Java 8 64-Bit. Please update your Java model to avoid memory overflow errors."); + } + StringUtil.printSection("aCis"); // Initialize config Index: java/net/sf/l2j/loginserver/LoginServer.java =================================================================== --- java/net/sf/l2j/loginserver/LoginServer.java (revision 100500) +++ java/net/sf/l2j/loginserver/LoginServer.java (working copy) @@ -38,6 +38,12 @@ public LoginServer() throws Exception { + if (!System.getProperty("java.specification.version").equals("1.8")) + { + System.out.println("This application require Java 8. Please update your Java version."); + System.exit(1); + } + // Create log folder new File("./log").mkdir(); new File("./log/console").mkdir(); |
This example was written for aCis Rev.36x sources, but can adapt for any L2J. Have fun!
Note: If you copy/paste info from the my blog to another resource, then don’t forget add link to this page.