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 0aa2f236..b8659a3c 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java @@ -141,7 +141,10 @@ public static JavaVersionAndBuild getJavaVersion(String version) { JavaVersionAndBuild result = new JavaVersionAndBuild(); if (version.startsWith("1.")) { result.version = Integer.parseInt(version.substring(2, 3)); - result.build = Integer.parseInt(version.substring(version.indexOf('_') + 1)); + int pos = version.indexOf('_'); + if (pos != -1) { + result.build = Integer.parseInt(version.substring(pos + 1)); + } } else { int dot = version.indexOf("."); if (dot != -1) {