From 6d6bcf62f438dced6ef5fb394d2b111358e857be Mon Sep 17 00:00:00 2001 From: ceikry Date: Fri, 30 Jul 2021 14:32:26 -0500 Subject: [PATCH] Let's try this. --- src/main/kotlin/Globals.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/Globals.kt b/src/main/kotlin/Globals.kt index 2f142a6..0199ad3 100644 --- a/src/main/kotlin/Globals.kt +++ b/src/main/kotlin/Globals.kt @@ -9,5 +9,10 @@ fun Component.placeAt(x: Int, y: Int, width: Int, height: Int){ fun launchClient() { println("Launching client now.") - Runtime.getRuntime().exec("java -jar " + Settings.SAVE_DIR + File.separator + Settings.SAVE_NAME, null, File(System.getProperty("user.home"))).also { exitProcess(0) } + var proc = Runtime.getRuntime().exec("java -jar " + Settings.SAVE_NAME, null, File(System.getProperty("user.home"))) + if(proc.isAlive){ + exitProcess(0) + } else { + MainWindow.loadingLabel.text = "Error starting the client." + } } \ No newline at end of file