mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-31 20:59:54 +03:00
[FIX] Java 17 detect
This commit is contained in:
parent
dabe2e8106
commit
d9b03d3c6a
1 changed files with 9 additions and 0 deletions
|
@ -151,6 +151,15 @@ public static JavaVersionAndBuild getJavaVersion(String version) {
|
||||||
result.version = Integer.parseInt(version.substring(0, dot));
|
result.version = Integer.parseInt(version.substring(0, dot));
|
||||||
dot = version.lastIndexOf(".");
|
dot = version.lastIndexOf(".");
|
||||||
result.build = Integer.parseInt(version.substring(dot + 1));
|
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;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue