diff --git a/src/main/java/net/knarcraft/minecraftserverlauncher/server/Server.java b/src/main/java/net/knarcraft/minecraftserverlauncher/server/Server.java index 0486361..3be1016 100644 --- a/src/main/java/net/knarcraft/minecraftserverlauncher/server/Server.java +++ b/src/main/java/net/knarcraft/minecraftserverlauncher/server/Server.java @@ -345,6 +345,7 @@ public class Server { return false; } if (ServerHandler.stoppingServers()) { + gui.logMessage("Stopping servers. Cannot start yet."); return false; } //Starts the server if possible @@ -367,14 +368,17 @@ public class Server { */ private String getJavaCommand() { ServerLauncherController controller = ServerLauncherController.getInstance(); + if (serverVersion.toLowerCase().contains("latest")) { return controller.getJavaCommand(); - } else if (serverVersion.contains(".") && serverVersion.split("\\.").length >= 2 && - Integer.parseInt(serverVersion.split("\\.")[1]) >= 17) { - return controller.getJavaCommand(); - } else { - return controller.getOldJavaCommand(); + } else if (serverVersion.contains(".") && serverVersion.split("\\.").length >= 2) { + try { + if (Integer.parseInt(serverVersion.split("\\.")[1]) >= 17) { + return controller.getJavaCommand(); + } + } catch (NumberFormatException ignored) {} } + return controller.getOldJavaCommand(); } /**