From d9b03d3c6aa41c97c464af56bb8d7799902b3b39 Mon Sep 17 00:00:00 2001 From: Gravita Date: Wed, 13 Oct 2021 14:38:38 +0700 Subject: [PATCH] [FIX] Java 17 detect --- .../main/java/pro/gravit/utils/helper/JavaHelper.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java index b8659a3c..ca23555f 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java @@ -151,6 +151,15 @@ public static JavaVersionAndBuild getJavaVersion(String version) { result.version = Integer.parseInt(version.substring(0, dot)); dot = version.lastIndexOf("."); result.build = Integer.parseInt(version.substring(dot + 1)); + } else { + try { + if(version.endsWith("-ea")) { + version = version.substring(0, version.length()-3); + } + result.version = Integer.parseInt(version); + result.build = 0; + } catch (NumberFormatException ignored) { + } } } return result;